Compare commits
26 Commits
1d8e9e2af9
...
ac1e748ad5
| Author | SHA1 | Date | |
|---|---|---|---|
| ac1e748ad5 | |||
|
|
08ada50d1a | ||
|
|
ab0c770167 | ||
|
|
e1ff8213bf | ||
|
|
87a2fe09de | ||
|
|
a4c5143ee5 | ||
|
|
c2eac572c0 | ||
|
|
7e049dfd08 | ||
|
|
2e30a103fd | ||
|
|
ac83a22ca6 | ||
|
|
cb44360b8a | ||
|
|
ac0c15a1a2 | ||
|
|
6a414d07df | ||
|
|
a33cbab7e3 | ||
|
|
2048796798 | ||
|
|
4d45196895 | ||
|
|
fa2481ea3d | ||
|
|
31f028d8d8 | ||
|
|
ed0727fa43 | ||
|
|
906b63feee | ||
|
|
bae1f2608a | ||
|
|
6f4067d50c | ||
|
|
848830a21b | ||
|
|
f63104591b | ||
|
|
93d7f2b43d | ||
|
|
b6bd32430b |
@@ -1,14 +1,14 @@
|
|||||||
# 本地开发环境
|
# 本地开发环境
|
||||||
NODE_ENV=development
|
VITE_NODE_ENV=development
|
||||||
|
|
||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
#VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
#VITE_BASE_URL='http://118.31.23.45:48080'
|
||||||
VITE_BASE_URL='http://localhost:48080'
|
VITE_BASE_URL='http://localhost:48080'
|
||||||
|
|
||||||
# 上传路径
|
# 上传路径
|
||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
# VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/crm-api
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window._AMapSecurityConfig = {
|
window._AMapSecurityConfig = {
|
||||||
securityJsCode: 'a2f0d14a4c5c1e387f9271b1045a781d' // 你的密钥
|
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.7 KiB |
@@ -38,3 +38,8 @@ export const getInventoryList = async (params) => {
|
|||||||
export const getInventoryRecord = async (params) => {
|
export const getInventoryRecord = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取剩余库存
|
||||||
|
export const getRemainInventoryList = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/erp-inventory-detail/list', params })
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ export const deletePlace = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updatePlaceStatus = async (id, status) => {
|
export const updatePlaceStatus = async (placeId, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
id,
|
placeId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-place/update-status', data: data })
|
return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ export const deleteSchool = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateSchoolStatus = async (id, status) => {
|
export const updateSchoolStatus = async (schoolId, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
id,
|
schoolId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-school/update-status', data: data })
|
return request.put({ url: '/admin-api/crm/sch-school/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ watch(
|
|||||||
(options) => {
|
(options) => {
|
||||||
if (echartRef) {
|
if (echartRef) {
|
||||||
echartRef?.setOption(options)
|
echartRef?.setOption(options)
|
||||||
|
resizeHandler()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ export default defineComponent({
|
|||||||
vModel={formModel.value[item.field]}
|
vModel={formModel.value[item.field]}
|
||||||
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
||||||
{...setComponentProps(item)}
|
{...setComponentProps(item)}
|
||||||
|
filterable
|
||||||
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
style={baseSty + item.componentProps?.style}
|
style={baseSty + item.componentProps?.style}
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ const usedSchema = ref([])
|
|||||||
|
|
||||||
const newSchema = computed(() => {
|
const newSchema = computed(() => {
|
||||||
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
||||||
|
schema.forEach((item: FormSchema) => {
|
||||||
|
if (item.component == 'TreeSelect') {
|
||||||
|
item.componentProps['check-strictly'] = true
|
||||||
|
}
|
||||||
|
})
|
||||||
if (props.expand && props.expandField && !unref(visible)) {
|
if (props.expand && props.expandField && !unref(visible)) {
|
||||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ const props = defineProps({
|
|||||||
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
||||||
title: propTypes.string.def('文件上传'),
|
title: propTypes.string.def('文件上传'),
|
||||||
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
||||||
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
// fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
|
fileType: propTypes.array.def([]),
|
||||||
accept: propTypes.string.def('*'),
|
accept: propTypes.string.def('*'),
|
||||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||||
limit: propTypes.number.def(5), // 数量限制
|
limit: propTypes.number.def(5), // 数量限制
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) {
|
|||||||
clear()
|
clear()
|
||||||
|
|
||||||
const can = document.createElement('canvas')
|
const can = document.createElement('canvas')
|
||||||
can.width = 300
|
can.width = 500
|
||||||
can.height = 240
|
can.height = 240
|
||||||
|
|
||||||
const cans = can.getContext('2d')
|
const cans = can.getContext('2d')
|
||||||
if (cans) {
|
if (cans) {
|
||||||
cans.rotate((-20 * Math.PI) / 120)
|
cans.rotate((-20 * Math.PI) / 120)
|
||||||
cans.font = '15px Vedana'
|
cans.font = '15px Vedana'
|
||||||
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
|
cans.fillStyle = 'rgba(0, 0, 0, 0.05)'
|
||||||
cans.textAlign = 'left'
|
cans.textAlign = 'left'
|
||||||
cans.textBaseline = 'middle'
|
cans.textBaseline = 'middle'
|
||||||
cans.fillText(str, can.width / 20, can.height)
|
cans.fillText(str, can.width / 20, can.height)
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ onMounted(() => {
|
|||||||
// 首次加载小红点
|
// 首次加载小红点
|
||||||
getUnreadCount()
|
getUnreadCount()
|
||||||
// 轮询刷新小红点
|
// 轮询刷新小红点
|
||||||
msgInterval.value = setInterval(() => {
|
// msgInterval.value = setInterval(() => {
|
||||||
getUnreadCount()
|
// getUnreadCount()
|
||||||
}, 1000 * 60 * 2)
|
// }, 1000 * 60 * 2)
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
|||||||
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||||
|
import { useWatermark } from '@/hooks/web/useWatermark'
|
||||||
|
|
||||||
|
const { setWatermark } = useWatermark()
|
||||||
|
|
||||||
|
setWatermark('安徽莳松科技有限公司')
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ const fixedMenuChange = (show: boolean) => {
|
|||||||
const setWater = () => {
|
const setWater = () => {
|
||||||
setWatermark(water.value)
|
setWatermark(water.value)
|
||||||
}
|
}
|
||||||
setWater()
|
|
||||||
|
|
||||||
const layout = computed(() => appStore.getLayout)
|
const layout = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-radio-group
|
<el-radio-group
|
||||||
v-model="form.usePhoneConfig"
|
v-model="form.usePhoneConfig"
|
||||||
:disabled="getConfig('usePhoneConfig').modifiable == 'false'"
|
:disabled="!getConfig('usePhoneConfig').modifiable"
|
||||||
>
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="files" label="附件">
|
<el-table-column prop="files" label="附件">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" underline :href="row.fileUrl" target="_blank">
|
<el-link type="primary" underline target="_blank" @click="handleDownload(row.files)">
|
||||||
{{ row.files }}
|
{{ row.files }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
@@ -195,6 +195,16 @@ function handleClickLib(index) {
|
|||||||
getResourceList()
|
getResourceList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDownload(href) {
|
||||||
|
if (href) {
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.download = href //指定下载的文件名
|
||||||
|
a.href = href // URL对象
|
||||||
|
a.click() // 模拟点击
|
||||||
|
URL.revokeObjectURL(a.href) // 释放URL 对象
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function openResource(type, id) {
|
function openResource(type, id) {
|
||||||
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户昵称" prop="nickname">
|
<el-form-item label="用户姓名" prop="nickname">
|
||||||
<el-input v-model="formData.nickname" placeholder="请输入用户昵称" />
|
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item v-if="formData.id === undefined" label="用户名称" prop="username">
|
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
||||||
<el-input v-model="formData.username" placeholder="请输入用户名称" />
|
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -142,8 +142,8 @@ const formData = ref({
|
|||||||
hireDate: ''
|
hireDate: ''
|
||||||
})
|
})
|
||||||
const formRules = ref<any>({
|
const formRules = ref<any>({
|
||||||
username: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
|
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||||
nickname: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
||||||
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
@@ -152,13 +152,7 @@ const formRules = ref<any>({
|
|||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
mobile: [
|
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||||
{
|
|
||||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
|
||||||
message: '请输入正确的手机号码',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
<el-col :span="20" :xs="24">
|
<el-col :span="20" :xs="24">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||||
<el-form-item label="用户名称" prop="username">
|
<el-form-item label="登录账号" prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.username"
|
v-model="queryParams.username"
|
||||||
placeholder="请输入用户名称"
|
placeholder="请输入登录账号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="用户编号" key="id" prop="id" />
|
<el-table-column label="用户编号" key="id" prop="id" />
|
||||||
<el-table-column label="用户名称" prop="username" />
|
<el-table-column label="登录账号" prop="username" />
|
||||||
<el-table-column label="用户昵称" prop="nickname" />
|
<el-table-column label="用户姓名" prop="nickname" />
|
||||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||||
<el-table-column label="状态" key="status">
|
<el-table-column label="状态" key="status">
|
||||||
|
|||||||
@@ -67,25 +67,23 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" border>
|
<el-table v-loading="loading" :data="tableList" border>
|
||||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||||
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||||
<el-table-column
|
<el-table-column prop="dealDate" label="登记时间" width="120px" :formatter="dateFormatter" />
|
||||||
prop="dealDate"
|
|
||||||
label="登记时间"
|
|
||||||
min-width="150px"
|
|
||||||
:formatter="dateFormatter"
|
|
||||||
/>
|
|
||||||
<el-table-column prop="productName" label="成交产品" min-width="150px" />
|
<el-table-column prop="productName" label="成交产品" min-width="150px" />
|
||||||
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
||||||
|
<el-table-column prop="signNum" label="销售数量" width="90px" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="createTime"
|
prop="createTime"
|
||||||
label="发货时间"
|
label="发货时间"
|
||||||
min-width="150px"
|
width="120px"
|
||||||
:formatter="dateFormatter"
|
:formatter="dateFormatter"
|
||||||
/>
|
/>
|
||||||
<el-table-column prop="warehouseName" label="发货仓库" min-width="100px" />
|
<el-table-column prop="batchNo" label="发货批次" min-width="120px" />
|
||||||
|
<el-table-column prop="warehouseName" label="发货仓库" min-width="120px" />
|
||||||
|
<el-table-column prop="sendNum" label="发货数量" width="90px" />
|
||||||
<el-table-column label="发货备注">
|
<el-table-column label="发货备注">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-popover
|
<el-popover
|
||||||
|
|||||||
@@ -1,8 +1,72 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="发货" v-model="show" width="600px">
|
<el-dialog title="发货" v-model="show" width="700px">
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="85px">
|
||||||
<el-form-item label="发货仓库" prop="warehouseId">
|
<el-row :gutter="20">
|
||||||
<el-select v-model="form.warehouseId" placeholder="选择仓库" filterable>
|
<el-col :span="8" :offset="0">
|
||||||
|
<el-form-item label="待发数量">
|
||||||
|
<span class="font-bold">:{{ form.sendTotalNum }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="16" :offset="0">
|
||||||
|
<el-form-item label="发货方式">
|
||||||
|
<el-radio-group v-model="form.sendType" :disabled="autoAuditPurchase == 'false'">
|
||||||
|
<el-radio :label="1">
|
||||||
|
<Tooltip
|
||||||
|
message="必须在进销存的“通用配置-常规配置”中,将 ’采购申请自动通过‘ 设置为“是”"
|
||||||
|
/>
|
||||||
|
立即采购发货
|
||||||
|
</el-radio>
|
||||||
|
<el-radio :label="2"> 使用库存发货 </el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<template v-if="form.sendType == 1">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="供应商" prop="supplier">
|
||||||
|
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in supplierOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="采购数量" prop="num">
|
||||||
|
<el-input-number
|
||||||
|
:min="form.sendTotalNum"
|
||||||
|
v-model="form.num"
|
||||||
|
:controls="false"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="采购单价" prop="unitPrice">
|
||||||
|
<el-input-number
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
v-model="form.unitPrice"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="存放仓库" prop="warehouseId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.warehouseId"
|
||||||
|
placeholder="请选择"
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in warehouseOptions"
|
v-for="item in warehouseOptions"
|
||||||
:key="item.warehouseId"
|
:key="item.warehouseId"
|
||||||
@@ -11,6 +75,29 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-table :data="inventoryList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="batchNo" label="入库批次号" width="150px" />
|
||||||
|
<el-table-column prop="warehouseName" label="存放仓库" width="120px" />
|
||||||
|
<el-table-column prop="price" label="采购价" width="90px" />
|
||||||
|
<el-table-column prop="num" label="剩余库存" width="90px" />
|
||||||
|
<el-table-column label="发货数量">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input-number
|
||||||
|
v-model="row.sendNum"
|
||||||
|
size="small"
|
||||||
|
:min="1"
|
||||||
|
:max="row.num"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<Editor v-model:modelValue="form.remark" />
|
<Editor v-model:modelValue="form.remark" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -25,22 +112,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogDelivery">
|
<script setup name="DialogDelivery">
|
||||||
import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
||||||
import { createDelivery } from '@/api/clue/delivery'
|
import { createDelivery } from '@/api/clue/delivery'
|
||||||
|
import { getConfigList } from '@/api/system/set'
|
||||||
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const warehouseOptions = ref([])
|
const warehouseOptions = ref([])
|
||||||
|
const supplierOptions = getDictOptions('erp_supplier')
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
getSimpleWarehouseList().then((data) => {
|
getSimpleWarehouseList().then((data) => {
|
||||||
warehouseOptions.value = data
|
warehouseOptions.value = data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRemainInventory(signProductId) {
|
||||||
|
getRemainInventoryList({ signProductId }).then((data) => {
|
||||||
|
inventoryList.value = data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
function open(id) {
|
function open(row) {
|
||||||
show.value = true
|
show.value = true
|
||||||
resetForm(id)
|
resetForm(row)
|
||||||
|
getRemainInventory(row.id)
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
@@ -48,12 +145,23 @@ defineExpose({
|
|||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
|
supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
|
||||||
|
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' },
|
||||||
|
num: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
|
||||||
|
unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
|
||||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
||||||
})
|
})
|
||||||
function resetForm(id) {
|
function resetForm(row) {
|
||||||
form.value = {
|
form.value = {
|
||||||
signProductId: id,
|
sendType: 2,
|
||||||
|
sendTotalNum: row.signNum,
|
||||||
|
signProductId: row.id,
|
||||||
|
productId: row.productId,
|
||||||
|
specsId: row.specsId,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
supplier: undefined,
|
||||||
|
num: row.signNum,
|
||||||
|
unitPrice: undefined,
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,12 +172,48 @@ const formRef = ref()
|
|||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
|
|
||||||
|
if (form.value.sendType == 1) {
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
|
} else {
|
||||||
|
if (!deliveryArr.value.length) {
|
||||||
|
message.info('请选择库存发货!')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
const deliveryCount = deliveryArr.value.reduce((pre, cur) => pre + cur.sendNum, 0)
|
||||||
|
if (deliveryCount < form.value.sendTotalNum) {
|
||||||
|
message.info('所选发货库存少于待发货数量,请重新选择后再发货!')
|
||||||
|
return
|
||||||
|
} else if (deliveryCount > form.value.sendTotalNum) {
|
||||||
|
message.info('所选发货库存多于待发货数量,请重新选择后再发货!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
await createDelivery(form.value)
|
let params = {
|
||||||
|
signProductId: form.value.signProductId,
|
||||||
|
sendType: form.value.sendType,
|
||||||
|
remark: form.value.remark
|
||||||
|
}
|
||||||
|
if (params.sendType == 1) {
|
||||||
|
params.purchaseOrder = {
|
||||||
|
productId: form.value.productId,
|
||||||
|
specsId: form.value.specsId,
|
||||||
|
supplier: form.value.supplier,
|
||||||
|
num: form.value.num,
|
||||||
|
unitPrice: form.value.unitPrice,
|
||||||
|
warehouseId: form.value.warehouseId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
params.detailList = inventoryList.value
|
||||||
|
}
|
||||||
|
|
||||||
|
await createDelivery(params)
|
||||||
message.success('发货成功!')
|
message.success('发货成功!')
|
||||||
show.value = false
|
show.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
@@ -78,8 +222,22 @@ async function onSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const inventoryList = ref([])
|
||||||
|
|
||||||
|
const deliveryArr = ref([])
|
||||||
|
function handleSelectionChange(val) {
|
||||||
|
deliveryArr.value = val
|
||||||
|
}
|
||||||
|
|
||||||
|
const autoAuditPurchase = ref('false')
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOptions()
|
getOptions()
|
||||||
|
getConfigList({ module: 3 }).then((data) => {
|
||||||
|
// 获取所有配置项
|
||||||
|
autoAuditPurchase.value = data.find(
|
||||||
|
(it) => it.configKey == 'purchaseAuditAutoCompleteConfig'
|
||||||
|
).configValue
|
||||||
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -7,20 +7,22 @@
|
|||||||
<el-tab-pane label="成交信息" name="orderInfo">
|
<el-tab-pane label="成交信息" name="orderInfo">
|
||||||
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
||||||
<template v-if="orderInfo.signProducts && orderInfo.signProducts.length">
|
<template v-if="orderInfo.signProducts && orderInfo.signProducts.length">
|
||||||
<el-divider direction="horizontal" content-position="left">成交产品</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-table :data="orderInfo.signProducts" border stripe>
|
<el-table :data="orderInfo.signProducts" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="productName" label="成交产品" />
|
<el-table-column prop="productName" label="成交产品" />
|
||||||
<el-table-column prop="specsName" label="产品规格" />
|
<el-table-column prop="specsName" label="产品规格" />
|
||||||
<el-table-column prop="signNum" label="成交数量" />
|
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||||
<el-table-column prop="warehouseName" label="发货仓库" />
|
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
||||||
<el-table-column label="发货备注">
|
<el-table-column label="发货备注">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="top"
|
placement="top"
|
||||||
width="500px"
|
width="500px"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
v-if="scope.row.sendRemark"
|
||||||
>
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
@@ -31,20 +33,33 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</template>
|
</template>
|
||||||
<el-divider direction="horizontal" content-position="left">其他费用</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-table :data="orderInfo.extraPay" border stripe>
|
<el-table :data="orderInfo.extraPay" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="费用项" />
|
<el-table-column prop="extraPayType" label="费用项" />
|
||||||
<el-table-column prop="extraPayMoney" label="金额" />
|
<el-table-column prop="extraPayMoney" label="金额" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-divider direction="horizontal" content-position="left">额外支出</el-divider>
|
<el-divider
|
||||||
|
v-if="prodTotalPrice + extraTotalPrice"
|
||||||
|
direction="horizontal"
|
||||||
|
content-position="left"
|
||||||
|
>
|
||||||
|
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
||||||
|
</el-divider>
|
||||||
|
<div v-if="checkPermi(['clue:order:add-fee'])">
|
||||||
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
额外支出<span v-if="extraPayTotalFee">,合计:{{ extraPayTotalFee }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-table :data="extraPayList" border stripe>
|
<el-table :data="extraPayList" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="支出项" />
|
<el-table-column prop="extraPayType" label="支出项" />
|
||||||
<el-table-column prop="extraPayMoney" label="金额" />
|
<el-table-column prop="extraPayMoney" label="金额" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="回款记录" name="returnRecord">
|
<el-tab-pane label="回款记录" name="returnRecord">
|
||||||
<el-table :data="returnRecordList" border stripe>
|
<el-table :data="returnRecordList" border stripe>
|
||||||
@@ -78,16 +93,39 @@ import { getSimpleFieldList as getOrderFieldList } from '@/api/clue/orderField'
|
|||||||
import { getPaymentPage } from '@/api/clue/payment'
|
import { getPaymentPage } from '@/api/clue/payment'
|
||||||
import { getAfterSalePage } from '@/api/clue/afterSale'
|
import { getAfterSalePage } from '@/api/clue/afterSale'
|
||||||
|
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const tabName = ref('clueInfo')
|
const tabName = ref('clueInfo')
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const clueInfo = ref({})
|
const clueInfo = ref({})
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({
|
||||||
|
signProducts: [],
|
||||||
|
extraPay: []
|
||||||
|
})
|
||||||
const returnRecordList = ref([])
|
const returnRecordList = ref([])
|
||||||
const aftersaleList = ref([])
|
const aftersaleList = ref([])
|
||||||
const extraPayList = ref([])
|
const extraPayList = ref([])
|
||||||
|
|
||||||
|
const prodTotalPrice = computed(() => {
|
||||||
|
return (
|
||||||
|
orderInfo.value.signProducts?.reduce(
|
||||||
|
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||||
|
0
|
||||||
|
) || 0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 其他费用
|
||||||
|
const extraTotalPrice = computed(() => {
|
||||||
|
return orderInfo.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 额外支出
|
||||||
|
const extraPayTotalFee = computed(() => {
|
||||||
|
return extraPayList.value.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
function open(clueId, orderId) {
|
function open(clueId, orderId) {
|
||||||
try {
|
try {
|
||||||
show.value = true
|
show.value = true
|
||||||
@@ -119,6 +157,9 @@ const orderSchema = ref([])
|
|||||||
function getFields() {
|
function getFields() {
|
||||||
getClueFieldList().then((data) => {
|
getClueFieldList().then((data) => {
|
||||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||||
|
if (arr.length % 2 != 0) {
|
||||||
|
arr.push({})
|
||||||
|
}
|
||||||
clueSchema.value = [
|
clueSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
@@ -137,6 +178,9 @@ function getFields() {
|
|||||||
|
|
||||||
getOrderFieldList().then((data) => {
|
getOrderFieldList().then((data) => {
|
||||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||||
|
if (arr.length % 2 != 0) {
|
||||||
|
arr.push({})
|
||||||
|
}
|
||||||
orderSchema.value = [
|
orderSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,16 +60,18 @@
|
|||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
|
@get-checked-columns="getCheckedColumns"
|
||||||
>
|
>
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="p-10px flex justify-center">
|
<div class="p-10px flex justify-center">
|
||||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||||
<el-table-column prop="productName" label="成交产品" />
|
<el-table-column prop="productName" label="成交产品" />
|
||||||
<el-table-column prop="specsName" label="产品规格" />
|
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||||
<el-table-column prop="signNum" label="成交数量" />
|
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||||
<el-table-column prop="warehouseName" label="发货仓库" />
|
<el-table-column prop="remark" label="成交备注" />
|
||||||
<el-table-column label="发货备注">
|
<el-table-column label="发货状态" prop="sendState" width="90px" />
|
||||||
|
<el-table-column label="发货备注" width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="top"
|
placement="top"
|
||||||
@@ -90,7 +92,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
:disabled="!!scope.row.warehouseName"
|
:disabled="scope.row.sendState == '已发货'"
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-hasPermi="['clue:order:send']"
|
v-hasPermi="['clue:order:send']"
|
||||||
@click="handleDelivery(scope.row)"
|
@click="handleDelivery(scope.row)"
|
||||||
@@ -104,7 +106,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in allSchemas.tableColumns"
|
v-for="item in showColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
@@ -151,7 +153,7 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == false"
|
v-if="scope.row.isPayoff == '未结清'"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
@@ -204,6 +206,15 @@ import DialogDelivery from './DialogDelivery.vue'
|
|||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
|
|
||||||
|
const userOptions = ref([])
|
||||||
|
onMounted(() => {
|
||||||
|
getUserOption().then((data) => {
|
||||||
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
|
})
|
||||||
|
getOptions()
|
||||||
|
})
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const allSchemas = ref({})
|
const allSchemas = ref({})
|
||||||
@@ -232,7 +243,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
@@ -240,7 +251,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.currentPage = 1
|
tableObject.value.pageNo = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -252,7 +263,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -282,6 +293,13 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showColumns = ref([])
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
function getCheckedColumns(list) {
|
||||||
|
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||||
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -327,17 +345,8 @@ function getOptions() {
|
|||||||
}
|
}
|
||||||
const deliveryDialog = ref()
|
const deliveryDialog = ref()
|
||||||
function handleDelivery(row) {
|
function handleDelivery(row) {
|
||||||
deliveryDialog.value.open(row.id)
|
deliveryDialog.value.open(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
onMounted(() => {
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
getCurdSchemas()
|
|
||||||
})
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -79,14 +79,30 @@
|
|||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
|
@get-checked-columns="getCheckedColumns"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in allSchemas.tableColumns"
|
v-for="item in showColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="120px"
|
min-width="120px"
|
||||||
/>
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="item.form?.component == 'Editor' && row[item.field]"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
<div v-dompurify-html="row.remark"></div>
|
||||||
|
</el-popover>
|
||||||
|
<span v-else>{{ row[item.field] }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="240px" fixed="right">
|
<el-table-column label="操作" width="240px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -114,12 +130,22 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == false"
|
v-if="scope.row.isPayoff == '未结清'"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
回款
|
回款
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="mr-10px"
|
||||||
|
link
|
||||||
|
style="padding: 0; margin-left: 0"
|
||||||
|
v-hasPermi="['clue:order:add-fee']"
|
||||||
|
@click="handleAddFee(scope.row)"
|
||||||
|
>
|
||||||
|
添加支出
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
@@ -138,6 +164,7 @@
|
|||||||
<DialogOrder ref="orderDetailDialog" />
|
<DialogOrder ref="orderDetailDialog" />
|
||||||
<DialogFeeback ref="feedbackDialog" />
|
<DialogFeeback ref="feedbackDialog" />
|
||||||
<DialogAfterSale ref="afterSaleDialog" />
|
<DialogAfterSale ref="afterSaleDialog" />
|
||||||
|
<DialogExtraFee ref="extraFeeDialog" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -151,9 +178,19 @@ import { getClassTypePage } from '@/api/school/class'
|
|||||||
import DialogOrder from './DialogOrder.vue'
|
import DialogOrder from './DialogOrder.vue'
|
||||||
import DialogFeeback from './DialogFeeback.vue'
|
import DialogFeeback from './DialogFeeback.vue'
|
||||||
import DialogAfterSale from './DialogAfterSale.vue'
|
import DialogAfterSale from './DialogAfterSale.vue'
|
||||||
|
import DialogExtraFee from './DialogExtraPay.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
|
|
||||||
|
const userOptions = ref([])
|
||||||
|
onMounted(() => {
|
||||||
|
getUserOption().then((data) => {
|
||||||
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
|
})
|
||||||
|
getOptions()
|
||||||
|
})
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const allSchemas = ref({})
|
const allSchemas = ref({})
|
||||||
@@ -175,7 +212,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const placeOptions = computed(() => {
|
const placeOptions = computed(() => {
|
||||||
@@ -190,7 +227,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.currentPage = 1
|
tableObject.value.pageNo = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -202,7 +239,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -232,6 +269,13 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showColumns = ref([])
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
function getCheckedColumns(list) {
|
||||||
|
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||||
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -249,6 +293,11 @@ function feeBack(row) {
|
|||||||
feedbackDialog.value.open(row.signId)
|
feedbackDialog.value.open(row.signId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const extraFeeDialog = ref()
|
||||||
|
function handleAddFee(row) {
|
||||||
|
extraFeeDialog.value.open(row.signId)
|
||||||
|
}
|
||||||
|
|
||||||
// 取消登记
|
// 取消登记
|
||||||
async function cancelDeal(row) {
|
async function cancelDeal(row) {
|
||||||
try {
|
try {
|
||||||
@@ -282,20 +331,11 @@ async function getClassTypeOptions() {
|
|||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
// 驾校
|
// 驾校
|
||||||
getPlaceList().then((data) => {
|
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||||
schoolOptions.value = data.schoolList
|
schoolOptions.value = data.schoolList
|
||||||
allPlaceOptions.value = data.placeList
|
allPlaceOptions.value = data.placeList
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
onMounted(() => {
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
getCurdSchemas()
|
|
||||||
})
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
269
src/views/Clue/Pool/Comp/ClueMap.vue
Normal file
269
src/views/Clue/Pool/Comp/ClueMap.vue
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
<template>
|
||||||
|
<div class="relative w-full h-full">
|
||||||
|
<div id="mapClue" style="height: 100%"></div>
|
||||||
|
<el-autocomplete
|
||||||
|
v-model="areaValue"
|
||||||
|
clearable
|
||||||
|
style="position: absolute; top: 20px; left: 20px; width: 400px"
|
||||||
|
placeholder="输入并搜索位置"
|
||||||
|
:fetch-suggestions="remoteMethod"
|
||||||
|
@select="currentSelect"
|
||||||
|
/>
|
||||||
|
<el-collapse v-model="collaspeKey" class="box-card">
|
||||||
|
<el-collapse-item name="nearbySchool">
|
||||||
|
<template #title>
|
||||||
|
<span class="ml-10px font-bold" style="font-size: 16px">附近驾校</span>
|
||||||
|
</template>
|
||||||
|
<div style="padding: 0 10px">
|
||||||
|
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||||
|
<template v-else>
|
||||||
|
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||||
|
<div class="hover-pointer" style="font-size: 14px; color: blue">
|
||||||
|
<i v-if="p.recommend" class="el-icon-star-off"></i>
|
||||||
|
驾校: {{ p.deptName }}-{{ p.name }}
|
||||||
|
</div>
|
||||||
|
<div class="mt5">地址:{{ p.address }}</div>
|
||||||
|
<div class="mt5">
|
||||||
|
直线距离: {{ p.distance }} 公里;
|
||||||
|
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||||
|
</div>
|
||||||
|
<el-divider style="margin: 3px 0 !important" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
<DialogSchoolInfo ref="placeInfoDialog" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ClueMap">
|
||||||
|
import { getPlaceList } from '@/api/school/place'
|
||||||
|
|
||||||
|
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||||
|
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||||
|
import FlagGreen from '@/assets/imgs/flag/flag_green.png'
|
||||||
|
import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
||||||
|
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||||
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
|
|
||||||
|
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||||
|
|
||||||
|
// 地图相关
|
||||||
|
const clueMap = ref(null)
|
||||||
|
const aMap = ref(null)
|
||||||
|
const areaValue = ref('')
|
||||||
|
|
||||||
|
const flagMap = {
|
||||||
|
red: FlagRed,
|
||||||
|
yellow: FlagYellow,
|
||||||
|
purple: FlagPurple,
|
||||||
|
green: FlagGreen,
|
||||||
|
blue: FlagBlue,
|
||||||
|
black: FlagBlack
|
||||||
|
}
|
||||||
|
|
||||||
|
const defaultLatLng = ref({
|
||||||
|
lat: 31.86119,
|
||||||
|
lng: 117.283042
|
||||||
|
})
|
||||||
|
|
||||||
|
let AutoComplete = ref(null)
|
||||||
|
function initMap() {
|
||||||
|
AMapLoader.load({
|
||||||
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
|
version: '2.0',
|
||||||
|
plugins: ['AMap.AutoComplete']
|
||||||
|
}).then((AMap) => {
|
||||||
|
aMap.value = AMap
|
||||||
|
AutoComplete.value = new AMap.AutoComplete({
|
||||||
|
city: '合肥'
|
||||||
|
})
|
||||||
|
clueMap.value = new AMap.Map('mapClue', {
|
||||||
|
zoom: 14,
|
||||||
|
zooms: [2, 22],
|
||||||
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||||
|
})
|
||||||
|
getPageData()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const placeList = ref([])
|
||||||
|
|
||||||
|
async function getPageData() {
|
||||||
|
placeList.value = []
|
||||||
|
const data = await getPlaceList({
|
||||||
|
placeStatus: 0
|
||||||
|
})
|
||||||
|
if (data.placeList) {
|
||||||
|
placeList.value = data.placeList
|
||||||
|
createMarkersInMap()
|
||||||
|
getNearbySchool(defaultLatLng.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成markers
|
||||||
|
function createMarkersInMap() {
|
||||||
|
for (let i = 0; i < placeList.value.length; i++) {
|
||||||
|
const element = placeList.value[i]
|
||||||
|
const markerIcon = flagMap[element.flagColor || 'red']
|
||||||
|
const tmpMarker = new aMap.value.Marker({
|
||||||
|
map: clueMap.value,
|
||||||
|
position: [element.lng, element.lat],
|
||||||
|
icon: markerIcon,
|
||||||
|
label: {
|
||||||
|
content: element.name,
|
||||||
|
direction: 'right'
|
||||||
|
},
|
||||||
|
extData: element
|
||||||
|
})
|
||||||
|
tmpMarker.on('click', handleClickMarker)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const placeInfoDialog = ref()
|
||||||
|
function handleClickMarker(ev) {
|
||||||
|
placeInfoDialog.value.open(ev.target.getExtData())
|
||||||
|
}
|
||||||
|
|
||||||
|
function remoteMethod(searchValue, cb) {
|
||||||
|
if (searchValue) {
|
||||||
|
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||||
|
if (result.tips?.length) {
|
||||||
|
// areaList.value = result?.tips
|
||||||
|
const list = result.tips.map((it) => ({
|
||||||
|
...it,
|
||||||
|
value: it.name
|
||||||
|
}))
|
||||||
|
cb(list)
|
||||||
|
} else {
|
||||||
|
cb([])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
cb([])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function currentSelect(val) {
|
||||||
|
if (val) {
|
||||||
|
defaultLatLng.value = {
|
||||||
|
lng: val.location?.lng,
|
||||||
|
lat: val.location?.lat
|
||||||
|
}
|
||||||
|
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const marker = ref(null)
|
||||||
|
function addmark(lat, lng, AMap) {
|
||||||
|
marker.value && removeMarker()
|
||||||
|
marker.value = new AMap.Marker({
|
||||||
|
position: new AMap.LngLat(lat, lng),
|
||||||
|
zoom: 14,
|
||||||
|
icon: ImgPostion,
|
||||||
|
offset: [-16, -32]
|
||||||
|
})
|
||||||
|
clueMap.value.add(marker.value)
|
||||||
|
clueMap.value.setCenter([lat, lng], true)
|
||||||
|
getNearbySchool({ lat: lng, lng: lat })
|
||||||
|
}
|
||||||
|
|
||||||
|
const nearbySchoolList = ref([])
|
||||||
|
const nearbySchoolSearching = ref(false)
|
||||||
|
const collaspeKey = ref('nearbySchool')
|
||||||
|
|
||||||
|
function getNearbySchool(info) {
|
||||||
|
if (info.lng && info.lat) {
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
nearbySchoolSearching.value = true
|
||||||
|
// 推荐的场地
|
||||||
|
let places1 = []
|
||||||
|
// 普通的场地
|
||||||
|
let places2 = []
|
||||||
|
|
||||||
|
const p2 = [info.lng, info.lat]
|
||||||
|
for (let i = 0; i < placeList.value.length; i++) {
|
||||||
|
const element = placeList.value[i]
|
||||||
|
const p1 = [element.lng, element.lat]
|
||||||
|
// 计算直线距离
|
||||||
|
element.distance = (aMap.value.GeometryUtil.distance(p1, p2) / 1000).toFixed(2)
|
||||||
|
element.recommend ? places1.push(element) : places2.push(element)
|
||||||
|
}
|
||||||
|
// 按直线距离排序
|
||||||
|
// 排序
|
||||||
|
if (places1.length > 1) {
|
||||||
|
places1 = places1.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 排序
|
||||||
|
if (places2.length > 1) {
|
||||||
|
places2 = places2.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 取普通场地和推荐场地,组合, 取四个
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
for (let i = 0; i < 4; i++) {
|
||||||
|
places1.length > i && nearbySchoolList.value.push(places1[i])
|
||||||
|
places2.length > i && nearbySchoolList.value.push(places2[i])
|
||||||
|
if (nearbySchoolList.value.length === 4) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算步行距离
|
||||||
|
nearbySchoolList.value.map(async (item) => {
|
||||||
|
const p1 = [item.lng, item.lat]
|
||||||
|
const resp = await getWalkingDistance(p1, p2)
|
||||||
|
item.walkdistance = resp
|
||||||
|
})
|
||||||
|
nearbySchoolSearching.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两点之间的步行距离
|
||||||
|
async function getWalkingDistance(start, end) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
aMap.value.plugin('AMap.Walking', () => {
|
||||||
|
const walking = new aMap.value.Walking()
|
||||||
|
let num = 0
|
||||||
|
walking.search(start, end, (status, result) => {
|
||||||
|
if (status === 'complete') {
|
||||||
|
result.routes.forEach((item) => {
|
||||||
|
num += item.distance
|
||||||
|
})
|
||||||
|
resolve(num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`)
|
||||||
|
} else {
|
||||||
|
resolve('步行数据无法确定')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeMarker() {
|
||||||
|
clueMap.value.remove(marker.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
function destroyMap() {
|
||||||
|
areaValue.value = undefined
|
||||||
|
clueMap.value = null
|
||||||
|
aMap.value = null
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({ destroyMap })
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
initMap()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.box-card {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
bottom: 10px;
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
||||||
<el-tabs v-model="tabName">
|
<el-tabs v-model="tabName" @tab-change="changeTab">
|
||||||
<el-tab-pane label="线索信息" name="info">
|
<el-tab-pane label="线索信息" name="info">
|
||||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="跟进信息" name="follow">
|
<el-tab-pane label="跟进信息" name="follow">
|
||||||
<el-button type="primary" @click="handleAppendFollow">新增跟进人</el-button>
|
<el-button type="primary" @click="handleAppendFollow">新增跟进人</el-button>
|
||||||
<el-table :data="followList">
|
<el-table :data="followList">
|
||||||
<el-table-column label="跟进人">
|
<el-table-column label="跟进人" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.userId"
|
v-model="row.userId"
|
||||||
@@ -24,13 +24,27 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="followTime" label="下次跟进时间">
|
<el-table-column prop="nextFollowTime" label="下次跟进时间" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="row.followTime"
|
v-model="row.nextFollowTime"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
:disabled="!row.editable"
|
:disabled="!row.editable"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="content" label="跟进内容">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input
|
||||||
|
v-model="row.content"
|
||||||
|
type="textarea"
|
||||||
|
:autoSize="{ minRows: 2 }"
|
||||||
|
placeholder="输入跟进内容"
|
||||||
|
:disabled="!row.editable"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -47,19 +61,16 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between items-center">
|
||||||
<el-select
|
<el-autocomplete
|
||||||
v-model="areaValue"
|
v-model="areaValue"
|
||||||
filterable
|
|
||||||
clearable
|
clearable
|
||||||
remote
|
style="width: 250px"
|
||||||
style="width: 350px"
|
placeholder="输入并搜索位置"
|
||||||
reserve-keyword
|
:fetch-suggestions="remoteMethod"
|
||||||
placeholder="请输入关键词"
|
@select="currentSelect"
|
||||||
:remote-method="remoteMethod"
|
|
||||||
@change="currentSelect"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<!-- <el-option
|
||||||
v-for="item in areaList"
|
v-for="item in areaList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
@@ -68,36 +79,65 @@
|
|||||||
>
|
>
|
||||||
<span style="float: left">{{ item.name }}</span>
|
<span style="float: left">{{ item.name }}</span>
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||||
</el-option>
|
</el-option> -->
|
||||||
</el-select>
|
</el-autocomplete>
|
||||||
|
<div class="flex-1 flex items-center ml-10px mr-10px">
|
||||||
|
<div class="w-100px">线索位置:</div>
|
||||||
|
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable />
|
||||||
|
</div>
|
||||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||||
展示场地
|
展示场地
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||||
<div class="flex items-center mt-10px mb-10px">
|
<el-collapse v-model="collaspeKey" class="box-card">
|
||||||
<div class="w-100px">线索位置:</div>
|
<el-collapse-item title="附近驾校" name="nearbySchool">
|
||||||
<el-input v-model="address" placeholder="请输入线索位置" clearable />
|
<template #header>附近驾校</template>
|
||||||
|
<div style="padding: 10px">
|
||||||
|
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||||
|
<template v-else>
|
||||||
|
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||||
|
<div
|
||||||
|
class="hover-pointer"
|
||||||
|
style="font-size: 14px; color: blue"
|
||||||
|
@click="getClassType(p)"
|
||||||
|
>
|
||||||
|
<i v-if="p.recommend" class="el-icon-star-off"></i>
|
||||||
|
驾校: {{ p.deptName }}-{{ p.name }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mt5">地址:{{ p.address }}</div>
|
||||||
|
<div class="mt5">
|
||||||
|
直线距离: {{ p.distance }} 公里;
|
||||||
|
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||||
|
</div>
|
||||||
|
<el-divider style="margin: 6px 0 !important" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<template #footer>
|
<div style="position: absolute; top: 75px; right: 20px">
|
||||||
<span>
|
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||||
</span>
|
</div>
|
||||||
</template>
|
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogClue">
|
<script setup name="DialogClue">
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
import * as ClueApi from '@/api/clue'
|
import * as ClueApi from '@/api/clue'
|
||||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
import ImgPostion from '@/assets/imgs/flag/flag_red.png'
|
|
||||||
|
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||||
|
|
||||||
|
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||||
@@ -106,7 +146,6 @@ import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
|||||||
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -119,8 +158,14 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const formSchema = computed(() => {
|
const formSchema = computed(() => {
|
||||||
|
const newSchema = [...props.schema]
|
||||||
|
newSchema.forEach((it) => {
|
||||||
|
if (it.field == 'consultTime') {
|
||||||
|
it.componentProps['disabled-date'] = dateAfterToday
|
||||||
|
}
|
||||||
|
})
|
||||||
return [
|
return [
|
||||||
...props.schema,
|
...newSchema,
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
label: '诉求',
|
label: '诉求',
|
||||||
@@ -143,6 +188,10 @@ const formSchema = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const dateAfterToday = (t) => {
|
||||||
|
return t.getTime() > Date.now()
|
||||||
|
}
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
@@ -162,7 +211,6 @@ const tabName = ref('info')
|
|||||||
const followList = ref([])
|
const followList = ref([])
|
||||||
|
|
||||||
const areaValue = ref('')
|
const areaValue = ref('')
|
||||||
const areaList = ref([])
|
|
||||||
const address = ref('')
|
const address = ref('')
|
||||||
const defaultLatLng = ref({
|
const defaultLatLng = ref({
|
||||||
lat: 31.86119,
|
lat: 31.86119,
|
||||||
@@ -193,37 +241,54 @@ const open = async (type, id) => {
|
|||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
followList.value = []
|
followList.value = [
|
||||||
|
{
|
||||||
|
userId: useUserStore().getUser.id,
|
||||||
|
content: undefined,
|
||||||
|
nextFollowTime: formatDate(new Date()),
|
||||||
|
editable: true
|
||||||
|
}
|
||||||
|
]
|
||||||
address.value = ''
|
address.value = ''
|
||||||
defaultLatLng.value = {
|
defaultLatLng.value = {
|
||||||
lat: 31.86119,
|
lat: 31.86119,
|
||||||
lng: 117.283042
|
lng: 117.283042
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
getSchoolPlace()
|
formRef.value.setValues(info.value)
|
||||||
initMap(info.value)
|
|
||||||
remoteMethod(address.value)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeTab() {
|
||||||
|
if (tabName.value == 'map') {
|
||||||
|
if (!dialogMap.value) {
|
||||||
|
nextTick(async () => {
|
||||||
|
await getSchoolPlace()
|
||||||
|
initMap(info.value)
|
||||||
|
// remoteMethod(address.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
destroyMap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
info.value.address = undefined
|
info.value.address = undefined
|
||||||
info.value.lat = undefined
|
info.value.lat = undefined
|
||||||
info.value.lng = undefined
|
info.value.lng = undefined
|
||||||
|
info.value.consultTime = formatDate(new Date())
|
||||||
info.value.followUsers = []
|
info.value.followUsers = []
|
||||||
info.value.diyParams = {}
|
info.value.diyParams = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeList = ref([])
|
const placeList = ref([])
|
||||||
function getSchoolPlace() {
|
async function getSchoolPlace() {
|
||||||
getPlaceList().then((data) => {
|
const data = await getPlaceList({ placeStatus: 0 })
|
||||||
placeList.value = data.placeList
|
placeList.value = data.placeList
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
@@ -233,10 +298,18 @@ async function handleSave() {
|
|||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
const valid = await formRef.value.getElFormRef().validate()
|
const valid = await formRef.value.getElFormRef().validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
|
if (!followList.value || followList.value.length == 0) {
|
||||||
|
message.info('请添加跟进人')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (followList.value && followList.value.length && followList.value.some((it) => !it.userId)) {
|
if (followList.value && followList.value.length && followList.value.some((it) => !it.userId)) {
|
||||||
message.info('请将跟进人填写完整!')
|
message.info('请将跟进人填写完整!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (appStore.getAppInfo?.instanceType == 1 && !address.value) {
|
||||||
|
message.info('请选择学员位置!')
|
||||||
|
return
|
||||||
|
}
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
@@ -254,11 +327,11 @@ async function handleSave() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await ClueApi.createClue(params)
|
const data = await ClueApi.createClue(params)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(data)
|
||||||
} else {
|
} else {
|
||||||
await ClueApi.updateClue(params)
|
const data = await ClueApi.updateClue(params)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(data)
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
@@ -271,7 +344,8 @@ async function handleSave() {
|
|||||||
function handleAppendFollow() {
|
function handleAppendFollow() {
|
||||||
followList.value.push({
|
followList.value.push({
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
followTime: formatDate(new Date()),
|
content: undefined,
|
||||||
|
nextFollowTime: formatDate(new Date()),
|
||||||
editable: true
|
editable: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -287,7 +361,7 @@ let geoCoder = ref(null)
|
|||||||
|
|
||||||
function initMap(data) {
|
function initMap(data) {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0',
|
version: '2.0',
|
||||||
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
@@ -299,15 +373,13 @@ function initMap(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialogMap.value = new AMap.Map('dialogMap', {
|
dialogMap.value = new AMap.Map('dialogMap', {
|
||||||
zoom: 12,
|
zoom: 14,
|
||||||
zooms: [2, 22],
|
zooms: [2, 22],
|
||||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||||
})
|
})
|
||||||
if (data.lng || data.lat) {
|
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||||
addmark(data.lng, data.lat, AMap)
|
|
||||||
}
|
|
||||||
AutoComplete.value = new AMap.AutoComplete({
|
AutoComplete.value = new AMap.AutoComplete({
|
||||||
city: '全国'
|
city: '合肥'
|
||||||
})
|
})
|
||||||
geoCoder.value = new AMap.Geocoder()
|
geoCoder.value = new AMap.Geocoder()
|
||||||
dialogMap.value.on('click', (e) => {
|
dialogMap.value.on('click', (e) => {
|
||||||
@@ -321,6 +393,74 @@ function initMap(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const collaspeKey = ref('nearbySchool')
|
||||||
|
const nearbySchoolSearching = ref(false)
|
||||||
|
const nearbySchoolList = ref([])
|
||||||
|
function getNearbySchool(info) {
|
||||||
|
if (info.lng && info.lat) {
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
nearbySchoolSearching.value = true
|
||||||
|
// 推荐的场地
|
||||||
|
let places1 = []
|
||||||
|
// 普通的场地
|
||||||
|
let places2 = []
|
||||||
|
|
||||||
|
const p2 = [info.lng, info.lat]
|
||||||
|
for (let i = 0; i < placeList.value.length; i++) {
|
||||||
|
const element = placeList.value[i]
|
||||||
|
const p1 = [element.lng, element.lat]
|
||||||
|
// 计算直线距离
|
||||||
|
element.distance = (aMap.value.GeometryUtil.distance(p1, p2) / 1000).toFixed(2)
|
||||||
|
element.recommend ? places1.push(element) : places2.push(element)
|
||||||
|
}
|
||||||
|
// 按直线距离排序
|
||||||
|
// 排序
|
||||||
|
if (places1.length > 1) {
|
||||||
|
places1 = places1.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 排序
|
||||||
|
if (places2.length > 1) {
|
||||||
|
places2 = places2.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 取普通场地和推荐场地,组合, 取四个
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
for (let i = 0; i < 4; i++) {
|
||||||
|
places1.length > i && nearbySchoolList.value.push(places1[i])
|
||||||
|
places2.length > i && nearbySchoolList.value.push(places2[i])
|
||||||
|
if (nearbySchoolList.value.length === 4) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算步行距离
|
||||||
|
nearbySchoolList.value.map(async (item) => {
|
||||||
|
const p1 = [item.lng, item.lat]
|
||||||
|
const resp = await getWalkingDistance(p1, p2)
|
||||||
|
item.walkdistance = resp
|
||||||
|
})
|
||||||
|
nearbySchoolSearching.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两点之间的步行距离
|
||||||
|
async function getWalkingDistance(start, end) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
aMap.value.plugin('AMap.Walking', () => {
|
||||||
|
const walking = new aMap.value.Walking()
|
||||||
|
let num = 0
|
||||||
|
walking.search(start, end, (status, result) => {
|
||||||
|
if (status === 'complete') {
|
||||||
|
result.routes.forEach((item) => {
|
||||||
|
num += item.distance
|
||||||
|
})
|
||||||
|
resolve(num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`)
|
||||||
|
} else {
|
||||||
|
resolve('步行数据无法确定')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function regeoCode(lng, lat) {
|
function regeoCode(lng, lat) {
|
||||||
try {
|
try {
|
||||||
geoCoder.value.getAddress([lng, lat], (status, result) => {
|
geoCoder.value.getAddress([lng, lat], (status, result) => {
|
||||||
@@ -341,10 +481,12 @@ function addmark(lat, lng, AMap) {
|
|||||||
marker.value = new AMap.Marker({
|
marker.value = new AMap.Marker({
|
||||||
position: new AMap.LngLat(lat, lng),
|
position: new AMap.LngLat(lat, lng),
|
||||||
zoom: 13,
|
zoom: 13,
|
||||||
icon: ImgPostion
|
icon: ImgPostion,
|
||||||
|
offset: [-16, -32]
|
||||||
})
|
})
|
||||||
dialogMap.value.add(marker.value)
|
dialogMap.value.add(marker.value)
|
||||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
dialogMap.value.setCenter([lat, lng], true)
|
||||||
|
getNearbySchool({ lat: lng, lng: lat })
|
||||||
}
|
}
|
||||||
function removeMarker() {
|
function removeMarker() {
|
||||||
dialogMap.value.remove(marker.value)
|
dialogMap.value.remove(marker.value)
|
||||||
@@ -376,6 +518,7 @@ function handleShowSchool() {
|
|||||||
extData: place,
|
extData: place,
|
||||||
clickable: true
|
clickable: true
|
||||||
})
|
})
|
||||||
|
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||||
schoolMarkers.value.push(marker)
|
schoolMarkers.value.push(marker)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -383,28 +526,43 @@ function handleShowSchool() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remoteMethod(searchValue) {
|
const schoolInfoDialog = ref()
|
||||||
if (searchValue !== '') {
|
function showSchoolInfo(val) {
|
||||||
setTimeout(() => {
|
schoolInfoDialog.value.open(val)
|
||||||
|
}
|
||||||
|
|
||||||
|
function remoteMethod(searchValue, cb) {
|
||||||
|
if (searchValue) {
|
||||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||||
if (result.tips?.length) {
|
if (result.tips?.length) {
|
||||||
areaList.value = result?.tips
|
// areaList.value = result?.tips
|
||||||
|
const list = result.tips.map((it) => ({
|
||||||
|
...it,
|
||||||
|
value: it.name
|
||||||
|
}))
|
||||||
|
cb(list)
|
||||||
|
} else {
|
||||||
|
cb([])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, 200)
|
} else {
|
||||||
|
cb([])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function currentSelect(val) {
|
function currentSelect(val) {
|
||||||
const area = areaList.value.find((it) => it.name == val)
|
if (val) {
|
||||||
if (area) {
|
defaultLatLng.value = {
|
||||||
addmark(area.location?.lng, area.location?.lat, aMap.value)
|
lng: val.location?.lng,
|
||||||
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500)
|
lat: val.location?.lat
|
||||||
regeoCode(area.location?.lng, area.location?.lat)
|
}
|
||||||
|
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||||
|
regeoCode(val.location?.lng, val.location?.lat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyMap() {
|
function destroyMap() {
|
||||||
|
areaValue.value = undefined
|
||||||
dialogMap.value = null
|
dialogMap.value = null
|
||||||
aMap.value = null
|
aMap.value = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="意向状态" prop="intentionState">
|
||||||
|
<el-select v-model="form.intentionState" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in intentionOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
@@ -80,9 +92,12 @@
|
|||||||
<script setup name="DialogFollow">
|
<script setup name="DialogFollow">
|
||||||
import { getSkillPage } from '@/api/clue/skill'
|
import { getSkillPage } from '@/api/clue/skill'
|
||||||
import { createFollow } from '@/api/clue/followRecord'
|
import { createFollow } from '@/api/clue/followRecord'
|
||||||
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
const intentionOptions = getDictOptions('intention_state')
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
@@ -97,18 +112,19 @@ const rules = {
|
|||||||
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
||||||
}
|
}
|
||||||
|
|
||||||
const open = async (clueId) => {
|
const open = async (clueId, status) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = '新增跟进记录'
|
dialogTitle.value = '新增跟进记录'
|
||||||
resetForm(clueId)
|
resetForm(clueId, status)
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
function resetForm(clueId) {
|
function resetForm(clueId, status) {
|
||||||
form.value = {
|
form.value = {
|
||||||
clueId,
|
clueId,
|
||||||
operateTime: undefined,
|
operateTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
|
||||||
nextFollowTime: undefined,
|
nextFollowTime: undefined,
|
||||||
|
intentionState: status,
|
||||||
content: undefined
|
content: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,6 +147,8 @@ function getSkillList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
|
|||||||
23
src/views/Clue/Pool/Comp/DialogSchoolInfo.vue
Normal file
23
src/views/Clue/Pool/Comp/DialogSchoolInfo.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog width="800px" :title="title" v-model="show" append-to-body>
|
||||||
|
<div v-dompurify-html="detail" class="mb-20px"></div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="DialogSchoolInfo">
|
||||||
|
const title = ref('')
|
||||||
|
const show = ref(false)
|
||||||
|
const detail = ref('')
|
||||||
|
|
||||||
|
function open(info) {
|
||||||
|
title.value = `【${info.schoolName}】详细信息`
|
||||||
|
show.value = true
|
||||||
|
detail.value = info.introduce || '该驾校暂未配置详细信息'
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog title="成交登记" v-model="show" width="820px">
|
<Dialog title="成交登记" v-model="show" width="900px">
|
||||||
<Descriptions
|
<Descriptions
|
||||||
:title="`线索信息-${info.name}`"
|
:title="`线索信息-${info.name}`"
|
||||||
:data="info"
|
:data="info"
|
||||||
@@ -124,7 +124,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<!-- 进销存模式 -->
|
<!-- 进销存模式 -->
|
||||||
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||||
<el-divider direction="horizontal" content-position="left">成交产品</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-button
|
<el-button
|
||||||
class="mb-5px"
|
class="mb-5px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -161,6 +163,11 @@
|
|||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
:disabled="!row.productId"
|
:disabled="!row.productId"
|
||||||
|
@change="
|
||||||
|
row.price = specsOptions(row.productId).find(
|
||||||
|
(it) => it.specsId == row.specsId
|
||||||
|
).price
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in specsOptions(row.productId)"
|
v-for="item in specsOptions(row.productId)"
|
||||||
@@ -171,6 +178,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" label="销售单价" width="100px" />
|
||||||
<el-table-column prop="signNum" label="成交数量" width="100px">
|
<el-table-column prop="signNum" label="成交数量" width="100px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@@ -199,7 +207,9 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" :offset="0" class="mb-18px">
|
<el-col :span="24" :offset="0" class="mb-18px">
|
||||||
<el-divider direction="horizontal" content-position="left">其他费用</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-button
|
<el-button
|
||||||
class="mb-5px"
|
class="mb-5px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -247,6 +257,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-divider
|
||||||
|
v-if="prodTotalPrice + extraTotalPrice"
|
||||||
|
direction="horizontal"
|
||||||
|
content-position="left"
|
||||||
|
>
|
||||||
|
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
||||||
|
</el-divider>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
@@ -302,6 +319,17 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const prodTotalPrice = computed(() => {
|
||||||
|
return form.value.signProducts.reduce(
|
||||||
|
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
const extraTotalPrice = computed(() => {
|
||||||
|
return form.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
const showSchema = computed(() => {
|
const showSchema = computed(() => {
|
||||||
const arr = [
|
const arr = [
|
||||||
{
|
{
|
||||||
@@ -417,7 +445,7 @@ async function getClassTypeOptions() {
|
|||||||
function getOptions() {
|
function getOptions() {
|
||||||
if (appStore.getAppInfo?.instanceType == 1) {
|
if (appStore.getAppInfo?.instanceType == 1) {
|
||||||
// 驾校
|
// 驾校
|
||||||
getPlaceList().then((data) => {
|
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||||
schoolOptions.value = data.schoolList
|
schoolOptions.value = data.schoolList
|
||||||
allPlaceOptions.value = data.placeList
|
allPlaceOptions.value = data.placeList
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
<el-tabs v-model="infoIndex" type="border-card">
|
<el-tabs v-model="infoIndex" type="border-card">
|
||||||
<el-tab-pane label="跟进记录" name="followRecord">
|
<el-tab-pane label="跟进记录" name="followRecord">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="followList.length"
|
||||||
v-hasPermi="['clue:pool:update']"
|
v-hasPermi="['clue:pool:update']"
|
||||||
class="mb-10px"
|
class="mb-10px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -83,6 +84,32 @@
|
|||||||
展示场地
|
展示场地
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||||
|
<el-collapse v-model="collaspeKey" class="box-card">
|
||||||
|
<el-collapse-item title="附近驾校" name="nearbySchool">
|
||||||
|
<template #header>附近驾校</template>
|
||||||
|
<div style="padding: 10px">
|
||||||
|
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||||
|
<template v-else>
|
||||||
|
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||||
|
<div
|
||||||
|
class="hover-pointer"
|
||||||
|
style="font-size: 14px; color: blue"
|
||||||
|
@click="getClassType(p)"
|
||||||
|
>
|
||||||
|
<i v-if="p.recommend" class="el-icon-star-off"></i>
|
||||||
|
驾校: {{ p.deptName }}-{{ p.name }}
|
||||||
|
</div>
|
||||||
|
<div class="mt5">地址:{{ p.address }}</div>
|
||||||
|
<div class="mt5">
|
||||||
|
直线距离: {{ p.distance }} 公里;
|
||||||
|
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||||
|
</div>
|
||||||
|
<el-divider style="margin: 6px 0 !important" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="操作记录" name="operateRecord">
|
<el-tab-pane label="操作记录" name="operateRecord">
|
||||||
@@ -113,7 +140,8 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<!-- 新建编辑跟进信息 -->
|
<!-- 新建编辑跟进信息 -->
|
||||||
<DialogFollow ref="followRef" @success="getFollowList" />
|
<DialogFollow ref="followRef" @success="followSuccess" />
|
||||||
|
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -124,10 +152,11 @@ import * as FollowApi from '@/api/clue/followRecord'
|
|||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
|
|
||||||
import DialogFollow from './DialogFollow.vue'
|
import DialogFollow from './DialogFollow.vue'
|
||||||
|
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
import { formatDate, dateFormatter } from '@/utils/formatTime'
|
import { formatDate, dateFormatter } from '@/utils/formatTime'
|
||||||
|
|
||||||
import ImgPostion from '@/assets/imgs/flag/position_blue.png'
|
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||||
@@ -150,7 +179,11 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const showSchema = computed(() => {
|
const showSchema = computed(() => {
|
||||||
const arr = [
|
const arr1 = [...props.schema]
|
||||||
|
if (arr1.length % 2 != 0) {
|
||||||
|
arr1.push({})
|
||||||
|
}
|
||||||
|
const arr2 = [
|
||||||
{
|
{
|
||||||
field: 'requirement',
|
field: 'requirement',
|
||||||
label: '诉求',
|
label: '诉求',
|
||||||
@@ -163,7 +196,7 @@ const showSchema = computed(() => {
|
|||||||
isEditor: true
|
isEditor: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
return [...props.schema, ...arr]
|
return [...arr1, ...arr2]
|
||||||
})
|
})
|
||||||
|
|
||||||
const followList = ref([])
|
const followList = ref([])
|
||||||
@@ -214,8 +247,8 @@ async function open(id) {
|
|||||||
infoIndex.value = 'followRecord'
|
infoIndex.value = 'followRecord'
|
||||||
|
|
||||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||||
nextTick(() => {
|
nextTick(async () => {
|
||||||
getSchoolPlace()
|
await getSchoolPlace()
|
||||||
initMap(info.value)
|
initMap(info.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -224,11 +257,18 @@ async function open(id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeList = ref([])
|
function followSuccess() {
|
||||||
function getSchoolPlace() {
|
ClueApi.getClue(clueId.value).then((data) => {
|
||||||
getPlaceList().then((data) => {
|
info.value = { ...data, ...data.diyParams }
|
||||||
placeList.value = data.placeList
|
|
||||||
})
|
})
|
||||||
|
getFollowList()
|
||||||
|
emit('getList')
|
||||||
|
}
|
||||||
|
|
||||||
|
const placeList = ref([])
|
||||||
|
async function getSchoolPlace() {
|
||||||
|
const data = await getPlaceList({ placeStatus: 0 })
|
||||||
|
placeList.value = data.placeList
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultLatLng = ref({
|
const defaultLatLng = ref({
|
||||||
@@ -238,7 +278,7 @@ const defaultLatLng = ref({
|
|||||||
|
|
||||||
function initMap(data) {
|
function initMap(data) {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0'
|
version: '2.0'
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
aMap.value = AMap
|
aMap.value = AMap
|
||||||
@@ -249,7 +289,7 @@ function initMap(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialogMap.value = new AMap.Map('dialogMap', {
|
dialogMap.value = new AMap.Map('dialogMap', {
|
||||||
zoom: 12,
|
zoom: 14,
|
||||||
zooms: [2, 22],
|
zooms: [2, 22],
|
||||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||||
})
|
})
|
||||||
@@ -285,6 +325,7 @@ function handleShowSchool() {
|
|||||||
extData: place,
|
extData: place,
|
||||||
clickable: true
|
clickable: true
|
||||||
})
|
})
|
||||||
|
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||||
schoolMarkers.value.push(marker)
|
schoolMarkers.value.push(marker)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -298,11 +339,87 @@ function addmark(lat, lng, AMap) {
|
|||||||
marker.value = new AMap.Marker({
|
marker.value = new AMap.Marker({
|
||||||
position: new AMap.LngLat(lat, lng),
|
position: new AMap.LngLat(lat, lng),
|
||||||
zoom: 13,
|
zoom: 13,
|
||||||
icon: ImgPostion
|
icon: ImgPostion,
|
||||||
|
offset: [-16, -32]
|
||||||
})
|
})
|
||||||
dialogMap.value.add(marker.value)
|
dialogMap.value.add(marker.value)
|
||||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||||
|
getNearbySchool({ lat: lng, lng: lat })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const collaspeKey = ref('nearbySchool')
|
||||||
|
const nearbySchoolSearching = ref(false)
|
||||||
|
const nearbySchoolList = ref([])
|
||||||
|
function getNearbySchool(info) {
|
||||||
|
if (info.lng && info.lat) {
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
nearbySchoolSearching.value = true
|
||||||
|
// 推荐的场地
|
||||||
|
let places1 = []
|
||||||
|
// 普通的场地
|
||||||
|
let places2 = []
|
||||||
|
|
||||||
|
const p2 = [info.lng, info.lat]
|
||||||
|
for (let i = 0; i < placeList.value.length; i++) {
|
||||||
|
const element = placeList.value[i]
|
||||||
|
const p1 = [element.lng, element.lat]
|
||||||
|
// 计算直线距离
|
||||||
|
element.distance = (aMap.value.GeometryUtil.distance(p1, p2) / 1000).toFixed(2)
|
||||||
|
element.recommend ? places1.push(element) : places2.push(element)
|
||||||
|
}
|
||||||
|
// 按直线距离排序
|
||||||
|
// 排序
|
||||||
|
if (places1.length > 1) {
|
||||||
|
places1 = places1.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 排序
|
||||||
|
if (places2.length > 1) {
|
||||||
|
places2 = places2.sort((a, b) => a.distance - b.distance)
|
||||||
|
}
|
||||||
|
// 取普通场地和推荐场地,组合, 取四个
|
||||||
|
nearbySchoolList.value = []
|
||||||
|
for (let i = 0; i < 4; i++) {
|
||||||
|
places1.length > i && nearbySchoolList.value.push(places1[i])
|
||||||
|
places2.length > i && nearbySchoolList.value.push(places2[i])
|
||||||
|
if (nearbySchoolList.value.length === 4) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算步行距离
|
||||||
|
nearbySchoolList.value.map(async (item) => {
|
||||||
|
const p1 = [item.lng, item.lat]
|
||||||
|
const resp = await getWalkingDistance(p1, p2)
|
||||||
|
item.walkdistance = resp
|
||||||
|
})
|
||||||
|
nearbySchoolSearching.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取两点之间的步行距离
|
||||||
|
async function getWalkingDistance(start, end) {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
aMap.value.plugin('AMap.Walking', () => {
|
||||||
|
const walking = new aMap.value.Walking()
|
||||||
|
let num = 0
|
||||||
|
walking.search(start, end, (status, result) => {
|
||||||
|
if (status === 'complete') {
|
||||||
|
result.routes.forEach((item) => {
|
||||||
|
num += item.distance
|
||||||
|
})
|
||||||
|
resolve(num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`)
|
||||||
|
} else {
|
||||||
|
resolve('步行数据无法确定')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const schoolInfoDialog = ref()
|
||||||
|
function showSchoolInfo(val) {
|
||||||
|
schoolInfoDialog.value.open(val)
|
||||||
|
}
|
||||||
|
|
||||||
function removeMarker() {
|
function removeMarker() {
|
||||||
dialogMap.value.remove(marker.value)
|
dialogMap.value.remove(marker.value)
|
||||||
}
|
}
|
||||||
@@ -315,7 +432,7 @@ defineExpose({
|
|||||||
|
|
||||||
const followRef = ref()
|
const followRef = ref()
|
||||||
function addFollow() {
|
function addFollow() {
|
||||||
followRef.value.open(info.value.clueId)
|
followRef.value.open(info.value.clueId, info.value.intentionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyMap() {
|
function destroyMap() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<el-tabs v-model="queryType" size="small" @tab-change="getTableList">
|
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
|
||||||
<el-tab-pane label="全部" name="0" />
|
<el-tab-pane label="全部" name="0" />
|
||||||
<el-tab-pane name="1">
|
<el-tab-pane name="1">
|
||||||
<template #label>
|
<template #label>
|
||||||
@@ -31,6 +31,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="公海" name="4" />
|
<el-tab-pane label="公海" name="4" />
|
||||||
|
<el-tab-pane
|
||||||
|
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||||
|
label="地图总览"
|
||||||
|
name="5"
|
||||||
|
style="height: calc(100vh - 160px)"
|
||||||
|
>
|
||||||
|
<ClueMap ref="mapClue" v-if="queryType == 5" />
|
||||||
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="absolute" style="right: 10px; top: 0">
|
<div class="absolute" style="right: 10px; top: 0">
|
||||||
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
||||||
@@ -39,6 +47,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<template v-if="queryType != 5">
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||||
<template #actionMore>
|
<template #actionMore>
|
||||||
@@ -69,6 +78,7 @@
|
|||||||
text
|
text
|
||||||
style="padding: 0"
|
style="padding: 0"
|
||||||
@click="handleFollow(row)"
|
@click="handleFollow(row)"
|
||||||
|
v-if="queryType != 4"
|
||||||
v-hasPermi="['clue:pool:update']"
|
v-hasPermi="['clue:pool:update']"
|
||||||
>
|
>
|
||||||
快速新增
|
快速新增
|
||||||
@@ -82,7 +92,12 @@
|
|||||||
<span>{{ formatDate(row[item.field]) }}</span>
|
<span>{{ formatDate(row[item.field]) }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||||
<p v-dompurify-html="row.remark"></p>
|
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
<div v-dompurify-html="row[item.field]"></div>
|
||||||
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<span v-else>{{ row[item.field] }}</span>
|
<span v-else>{{ row[item.field] }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -109,7 +124,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
:disabled="scope.row.state == '已成交'"
|
:disabled="scope.row.state == '成交'"
|
||||||
@click="handleSuccess(scope.row)"
|
@click="handleSuccess(scope.row)"
|
||||||
v-hasPermi="['clue:pool:enroll']"
|
v-hasPermi="['clue:pool:enroll']"
|
||||||
>
|
>
|
||||||
@@ -137,13 +152,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</SSTable>
|
</SSTable>
|
||||||
|
</template>
|
||||||
|
|
||||||
<DialogClue
|
<DialogClue
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:userOptions="userOptions"
|
:userOptions="userOptions"
|
||||||
:schema="allSchemas.formSchema"
|
:schema="allSchemas.formSchema"
|
||||||
@sucess="getTableList"
|
@success="getTableList"
|
||||||
/>
|
/>
|
||||||
<DrawerClue
|
<DrawerClue
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
@@ -158,11 +174,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="CluePool">
|
<script setup name="CluePool">
|
||||||
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { getSimpleFieldList } from '@/api/clue/clueField'
|
import { getSimpleFieldList } from '@/api/clue/clueField'
|
||||||
import DialogClue from './Comp/DialogClue.vue'
|
import DialogClue from './Comp/DialogClue.vue'
|
||||||
import DrawerClue from './Comp/DrawerClue.vue'
|
import DrawerClue from './Comp/DrawerClue.vue'
|
||||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||||
import DialogFollow from './Comp/DialogFollow.vue'
|
import DialogFollow from './Comp/DialogFollow.vue'
|
||||||
|
import ClueMap from './Comp/ClueMap.vue'
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
@@ -171,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
|
|||||||
import * as ClueApi from '@/api/clue'
|
import * as ClueApi from '@/api/clue'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const searchRef = ref()
|
const searchRef = ref()
|
||||||
const queryType = ref('2')
|
const queryType = ref('2')
|
||||||
@@ -207,20 +226,34 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const showColumns = ref([])
|
const showColumns = ref([])
|
||||||
|
|
||||||
// 初始化表格
|
// 初始化表格
|
||||||
function getCheckedColumns(list) {
|
function getCheckedColumns(list) {
|
||||||
showColumns.value = list
|
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||||
|
}
|
||||||
|
|
||||||
|
const mapClue = ref()
|
||||||
|
function quickChange(name) {
|
||||||
|
try {
|
||||||
|
if (name != '5') {
|
||||||
|
resetQuery()
|
||||||
|
mapClue.value && mapClue.value.destroyMap()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
searchRef.value.reset()
|
nextTick(() => {
|
||||||
tableObject.value.currentPage = 1
|
searchRef.value && searchRef.value.reset()
|
||||||
|
tableObject.value.pageNo = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTableList() {
|
async function getTableList() {
|
||||||
@@ -231,7 +264,7 @@ async function getTableList() {
|
|||||||
const queryParams = await searchRef.value.getFormModel()
|
const queryParams = await searchRef.value.getFormModel()
|
||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize,
|
pageSize: tableObject.value.pageSize,
|
||||||
queryType: queryType.value
|
queryType: queryType.value
|
||||||
}
|
}
|
||||||
@@ -268,7 +301,7 @@ function handleDetail(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleFollow(row) {
|
function handleFollow(row) {
|
||||||
followRef.value.open(row.clueId)
|
followRef.value.open(row.clueId, row.intentionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function makeCall(phone) {
|
async function makeCall(phone) {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig')">
|
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig') && props.appType == 2">
|
||||||
<template #label>
|
<template #label>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||||
@@ -66,6 +66,13 @@ import * as ConfigApi from '@/api/system/set'
|
|||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
appType: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
|
|
||||||
const configList = ref([])
|
const configList = ref([])
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<OtherPayType v-if="tabIndex == 37" />
|
<OtherPayType v-if="tabIndex == 37" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
|
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
|
||||||
<GeneralSet v-if="tabIndex == 40" />
|
<GeneralSet v-if="tabIndex == 40" :appType="appStore.getAppInfo?.instanceType" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
<!-- <el-tab-pane label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
||||||
<MsgSend v-if="tabIndex == 50" />
|
<MsgSend v-if="tabIndex == 50" />
|
||||||
@@ -56,6 +56,10 @@ import OtherPayType from './Comp/OtherPayType.vue'
|
|||||||
import GeneralSet from './Comp/GeneralSet.vue'
|
import GeneralSet from './Comp/GeneralSet.vue'
|
||||||
import { checkPermi } from '@/utils/permission'
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const tabIndex = ref(0)
|
const tabIndex = ref(0)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -67,21 +67,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-row class="mt-10px" :gutter="10" justify="space-between">
|
<div class="mt-10px flex">
|
||||||
<!-- <el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="mb-10px">
|
<el-card shadow="never" class="flex-1">
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<div class="flex justify-between ">
|
|
||||||
<span>本月成交来源</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-skeleton :loading="loading" animated>
|
|
||||||
<Echart :options="pieOptionsData" :height="280" />
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
</el-col> -->
|
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<span>成交率</span>
|
<span>成交率</span>
|
||||||
@@ -93,9 +80,7 @@
|
|||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
<el-card shadow="never" class="ml-10px">
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<span>跟进榜Top10</span>
|
<span>跟进榜Top10</span>
|
||||||
@@ -117,14 +102,12 @@
|
|||||||
<span class="mr-10px">{{ item.username }}</span>
|
<span class="mr-10px">{{ item.username }}</span>
|
||||||
<span>已跟进{{ item.followNum }}条线索</span>
|
<span>已跟进{{ item.followNum }}条线索</span>
|
||||||
</li>
|
</li>
|
||||||
<br />
|
<!-- <br /> -->
|
||||||
<!-- </TransitionGroup> -->
|
<!-- </TransitionGroup> -->
|
||||||
</ul>
|
</ul>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
<el-card shadow="never" class="ml-10px">
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between"> 本月成交榜Top10 </div>
|
<div class="flex justify-between"> 本月成交榜Top10 </div>
|
||||||
</template>
|
</template>
|
||||||
@@ -137,8 +120,19 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
<!-- <el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="mb-10px">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<div class="flex justify-between ">
|
||||||
|
<span>本月成交来源</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<Echart :options="pieOptionsData" :height="280" />
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
</el-col> -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Home">
|
<script setup lang="ts" name="Home">
|
||||||
|
|||||||
@@ -42,25 +42,7 @@ export const lineOptions: EChartsOption = {
|
|||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: []
|
||||||
{
|
|
||||||
name: '成交率',
|
|
||||||
smooth: true,
|
|
||||||
type: 'line',
|
|
||||||
data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
|
|
||||||
animationDuration: 2800,
|
|
||||||
animationEasing: 'cubicInOut'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: t('analysis.actual'),
|
|
||||||
smooth: true,
|
|
||||||
type: 'line',
|
|
||||||
itemStyle: {},
|
|
||||||
data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
|
|
||||||
animationDuration: 2800,
|
|
||||||
animationEasing: 'quadraticOut'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pieOptions: EChartsOption = {
|
export const pieOptions: EChartsOption = {
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form inline :model="searchForm" class="-mb-15px" label-width="0">
|
<el-form inline :model="searchForm" class="-mb-15px" label-width="0">
|
||||||
|
<el-form-item>
|
||||||
|
<el-select v-model="searchForm.changeType" placeholder="变动类型" clearable filterable>
|
||||||
|
<el-option label="入库" :value="1" />
|
||||||
|
<el-option label="出库" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.productId"
|
v-model="searchForm.productId"
|
||||||
@@ -43,6 +49,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchForm.batchNo" placeholder="批次号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleSearch"> 搜索 </el-button>
|
<el-button @click="handleSearch"> 搜索 </el-button>
|
||||||
<el-button @click="resetQuery"> 重置 </el-button>
|
<el-button @click="resetQuery"> 重置 </el-button>
|
||||||
@@ -53,17 +63,26 @@
|
|||||||
<el-table-column type="index" width="50px" />
|
<el-table-column type="index" width="50px" />
|
||||||
<el-table-column prop="productName" label="产品名称" />
|
<el-table-column prop="productName" label="产品名称" />
|
||||||
<el-table-column prop="specsName" label="规格" />
|
<el-table-column prop="specsName" label="规格" />
|
||||||
<el-table-column label="变动类型">
|
<el-table-column label="变动类型" width="90px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ ['', '入库', '出库'][row.changeType] }}
|
{{ ['', '入库', '出库'][row.changeType] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="num" label="数量" />
|
<el-table-column prop="num" label="变动数量" width="90px" />
|
||||||
<!-- <el-table-column prop="money" label="金额" /> -->
|
<el-table-column prop="batchNo" label="批次号" />
|
||||||
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
||||||
<el-table-column prop="changeUserName" label="变动人员" />
|
<el-table-column prop="changeUserName" label="变动人员" />
|
||||||
<el-table-column prop="warehouseName" label="所属仓库" />
|
<el-table-column prop="warehouseName" label="所属仓库" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
<div v-dompurify-html="scope.row.remark"></div>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<Pagination
|
<Pagination
|
||||||
v-model:limit="searchForm.pageSize"
|
v-model:limit="searchForm.pageSize"
|
||||||
@@ -78,11 +97,14 @@
|
|||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { getSimpleWarehouseList, getInventoryRecord } from '@/api/mall/warehouse'
|
import { getSimpleWarehouseList, getInventoryRecord } from '@/api/mall/warehouse'
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
import { getSimpleProductList } from '@/api/mall/product'
|
||||||
|
import { removeNullField } from '@/utils'
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
pproductId: undefined,
|
pproductId: undefined,
|
||||||
specsId: undefined,
|
specsId: undefined,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
changeType: undefined,
|
||||||
|
batchNo: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
@@ -102,6 +124,8 @@ function resetQuery() {
|
|||||||
productId: undefined,
|
productId: undefined,
|
||||||
specsId: undefined,
|
specsId: undefined,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
changeType: undefined,
|
||||||
|
batchNo: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
@@ -133,7 +157,7 @@ function changeProd(val) {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await getInventoryRecord(searchForm.value)
|
const data = await getInventoryRecord(removeNullField(searchForm.value))
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -387,14 +387,16 @@ function onSubmit() {
|
|||||||
const element = diyFieldList.value[i]
|
const element = diyFieldList.value[i]
|
||||||
data.diyParams[element.field] = data[element.field]
|
data.diyParams[element.field] = data[element.field]
|
||||||
}
|
}
|
||||||
const id = route.query.id
|
const id = route.query.id || form.value.productId
|
||||||
if (!id) {
|
if (!id) {
|
||||||
await ProductApi.createProduct(data)
|
const resp = await ProductApi.createProduct(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
|
form.value.productId = resp
|
||||||
} else {
|
} else {
|
||||||
await ProductApi.updateProduct(data)
|
await ProductApi.updateProduct(data)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
}
|
}
|
||||||
|
getDetail()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -461,10 +463,11 @@ const formLoading = ref(false)
|
|||||||
|
|
||||||
/** 获得详情 */
|
/** 获得详情 */
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
if (route.query?.id) {
|
const id = route.query?.id || form.value.productId
|
||||||
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await ProductApi.getProduct(route.query.id)
|
const res = await ProductApi.getProduct(id)
|
||||||
let diyField = {}
|
let diyField = {}
|
||||||
if (res.diyParams) {
|
if (res.diyParams) {
|
||||||
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
||||||
@@ -485,8 +488,8 @@ const getDetail = async () => {
|
|||||||
productCategory: undefined,
|
productCategory: undefined,
|
||||||
productBrand: undefined,
|
productBrand: undefined,
|
||||||
productIntro: undefined,
|
productIntro: undefined,
|
||||||
mainImage: 'https://ss-cloud.ahduima.com/1001/1796426117251600384.png',
|
mainImage: '',
|
||||||
carouselImages: ['https://ss-cloud.ahduima.com/1001/1796426117251600384.png'],
|
carouselImages: [],
|
||||||
productSpecList: [],
|
productSpecList: [],
|
||||||
skuList: [],
|
skuList: [],
|
||||||
detailInfo: null,
|
detailInfo: null,
|
||||||
|
|||||||
@@ -42,7 +42,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="采购数量" prop="num">
|
<el-form-item label="采购数量" prop="num">
|
||||||
<el-input-number :min="1" v-model="form.num" placeholder="请输入" style="width: 100%" />
|
<el-input-number
|
||||||
|
:min="1"
|
||||||
|
v-model="form.num"
|
||||||
|
:controls="false"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -51,6 +57,7 @@
|
|||||||
<el-form-item label="采购单价" prop="unitPrice">
|
<el-form-item label="采购单价" prop="unitPrice">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
v-model="form.unitPrice"
|
v-model="form.unitPrice"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ const crudSchemas = reactive([
|
|||||||
label: '备注',
|
label: '备注',
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
isSearch: false,
|
isSearch: false,
|
||||||
isTable: true
|
isTable: false
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
:options="props.schoolOption"
|
:options="props.schoolOption"
|
||||||
v-model="formData.schPlace"
|
v-model="formData.schPlace"
|
||||||
filterable
|
filterable
|
||||||
:props="{ value: 'id' }"
|
:props="{ value: 'value' }"
|
||||||
show-all-levels
|
show-all-levels
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,21 +2,16 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-form :model="searchForm" ref="searchRef" inline label-width="0">
|
<el-form :model="searchForm" ref="searchRef" inline label-width="0">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input
|
<el-cascader
|
||||||
v-model="searchForm.schoolName"
|
:options="schoolOption"
|
||||||
placeholder="请输入驾校名称"
|
v-model="searchForm.schPlace"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
filterable
|
||||||
@keyup.enter="handleQuery"
|
show-all-levels
|
||||||
/>
|
style="width: 300px"
|
||||||
</el-form-item>
|
placeholder="选择驾校/场地"
|
||||||
<el-form-item>
|
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }"
|
||||||
<el-input
|
@change="handleQuery"
|
||||||
v-model="searchForm.placeName"
|
|
||||||
placeholder="请输入场地名称"
|
|
||||||
clearable
|
|
||||||
style="width: 180px"
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -56,7 +51,7 @@
|
|||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleBatchDelete"
|
@click="handleBatchDelete([])"
|
||||||
v-hasPermi="['school:class:batch-delete']"
|
v-hasPermi="['school:class:batch-delete']"
|
||||||
>批量删除</el-button
|
>批量删除</el-button
|
||||||
>
|
>
|
||||||
@@ -69,21 +64,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="6" :offset="0">
|
|
||||||
<div class="head-container" style="max-height: 700px; overflow-y: auto">
|
|
||||||
<el-tree
|
|
||||||
ref="tree"
|
|
||||||
:data="schoolOption"
|
|
||||||
accordion
|
|
||||||
node-key="id"
|
|
||||||
highlight-current
|
|
||||||
:default-expanded-keys="selectNodes.map((item) => item.id)"
|
|
||||||
@node-click="handleNodeClick"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="18" :offset="0">
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableList"
|
:data="tableList"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
@@ -139,15 +119,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页 -->
|
|
||||||
<Pagination
|
<Pagination
|
||||||
v-model:limit="searchForm.pageSize"
|
v-model:limit="searchForm.pageSize"
|
||||||
v-model:page="searchForm.pageNo"
|
v-model:page="searchForm.pageNo"
|
||||||
:total="total"
|
:total="total"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px">
|
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px">
|
||||||
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
||||||
<el-form-item label="选择状态" prop="status">
|
<el-form-item label="选择状态" prop="status">
|
||||||
@@ -186,8 +163,7 @@ const total = ref(0)
|
|||||||
const tableList = ref([])
|
const tableList = ref([])
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
schoolName: undefined,
|
schPlace: undefined,
|
||||||
placeName: undefined,
|
|
||||||
typeName: undefined,
|
typeName: undefined,
|
||||||
licenseType: undefined,
|
licenseType: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -195,41 +171,28 @@ const searchForm = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const schoolOption = ref([])
|
const schoolOption = ref([])
|
||||||
const selectNodes = ref([])
|
// const selectNodes = ref([])
|
||||||
|
|
||||||
async function getSchoolList() {
|
async function getSchoolList() {
|
||||||
try {
|
try {
|
||||||
const data = await PlaceApi.getPlaceList()
|
const data = await PlaceApi.getPlaceList({
|
||||||
|
placeStatus: 0,
|
||||||
|
schoolStatus: 0,
|
||||||
|
isSearchSchool: true
|
||||||
|
})
|
||||||
schoolOption.value = data.schoolList.map((item) => ({
|
schoolOption.value = data.schoolList.map((item) => ({
|
||||||
id: item.schoolId,
|
value: item.schoolId,
|
||||||
label: item.schoolName,
|
label: item.schoolName,
|
||||||
level: 1,
|
|
||||||
children: data.placeList
|
children: data.placeList
|
||||||
.filter((place) => item.schoolId === place.schoolId)
|
.filter((place) => item.schoolId === place.schoolId)
|
||||||
.map((place) => ({
|
.map((place) => ({
|
||||||
id: place.placeId,
|
value: place.placeId,
|
||||||
label: place.name,
|
label: place.name
|
||||||
level: 2
|
|
||||||
}))
|
}))
|
||||||
}))
|
}))
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNodeClick(data, node) {
|
|
||||||
if (data.level === 1) {
|
|
||||||
selectNodes.value = [{ id: data.id, name: data.label }]
|
|
||||||
searchForm.value.schoolName = data.label
|
|
||||||
} else {
|
|
||||||
selectNodes.value = [
|
|
||||||
{ id: node.parent.data.id, name: node.parent.data.label },
|
|
||||||
{ id: data.id, name: data.label }
|
|
||||||
]
|
|
||||||
searchForm.value.schoolName = node.parent.data.label
|
|
||||||
searchForm.value.placeName = data.label
|
|
||||||
}
|
|
||||||
handleQuery()
|
|
||||||
}
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ props: 'schoolName', label: '驾校', width: '100px' },
|
{ props: 'schoolName', label: '驾校', width: '100px' },
|
||||||
{ props: 'placeName', label: '场地' },
|
{ props: 'placeName', label: '场地' },
|
||||||
@@ -248,7 +211,15 @@ function handleQuery() {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await ClassApi.getClassTypePage(searchForm.value)
|
const params = { ...searchForm.value }
|
||||||
|
if (params.schPlace && params.schPlace.length) {
|
||||||
|
params.schoolId = params.schPlace[0]
|
||||||
|
if (params.schPlace.length == 2) {
|
||||||
|
params.placeId = params.schPlace[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete params.schPlace
|
||||||
|
const data = await ClassApi.getClassTypePage(params)
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
@@ -263,8 +234,7 @@ function handleOpenDialog(type, id = null) {
|
|||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
searchForm.value = {
|
searchForm.value = {
|
||||||
schoolName: undefined,
|
schPlace: undefined,
|
||||||
placeName: undefined,
|
|
||||||
typeName: undefined,
|
typeName: undefined,
|
||||||
licenseType: undefined,
|
licenseType: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -274,7 +244,7 @@ function handleReset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleBatchDelete(arr = []) {
|
async function handleBatchDelete(arr = []) {
|
||||||
if (!arr.length || !selectRows.value.length) {
|
if (!arr.length && !selectRows.value.length) {
|
||||||
message.info('请选择表格行!')
|
message.info('请选择表格行!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -303,11 +273,17 @@ async function handleChangeStatus(row) {
|
|||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.confirm('是否确认修改状态')
|
await message.confirm('是否确认修改状态')
|
||||||
// 发起删除
|
// 发起删除
|
||||||
await ClassApi.updateClassTypeStatus(row.typeId, row.status)
|
await ClassApi.updateClassTypeStatus({
|
||||||
|
typeId: row.typeId,
|
||||||
|
status: row.status
|
||||||
|
})
|
||||||
message.success('修改成功')
|
message.success('修改成功')
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch {
|
||||||
|
// 取消后,进行恢复按钮
|
||||||
|
row.status = row.status === 1 ? 0 : 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const batchStatusDialogShow = ref(false)
|
const batchStatusDialogShow = ref(false)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="描述" name="desc">
|
<el-tab-pane label="描述" name="desc">
|
||||||
<Editor v-model:modelValue="placeForm.remark" />
|
<Editor v-model:modelValue="placeForm.introduce" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="flex items-center justify-center mt-10px">
|
<div class="flex items-center justify-center mt-10px">
|
||||||
@@ -190,8 +190,10 @@
|
|||||||
<el-table-column label="启用" width="100">
|
<el-table-column label="启用" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.showInMap"
|
v-model="scope.row.status"
|
||||||
:disabled="checkPermi(['school:place:update'])"
|
:active-value="0"
|
||||||
|
:inactive-value="1"
|
||||||
|
:disabled="!checkPermi(['school:place:update'])"
|
||||||
@change="changePlaceStatus(scope.row)"
|
@change="changePlaceStatus(scope.row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -266,7 +268,7 @@ const placeTab = ref('info')
|
|||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0',
|
version: '2.0',
|
||||||
plugins: ['AMap.Geocoder']
|
plugins: ['AMap.Geocoder']
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
@@ -323,7 +325,10 @@ function regeoCode() {
|
|||||||
async function getPageData() {
|
async function getPageData() {
|
||||||
schoolList.value = []
|
schoolList.value = []
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
const data = await PlaceApi.getPlaceList()
|
const data = await PlaceApi.getPlaceList({
|
||||||
|
schoolStatus: 0,
|
||||||
|
isSearchSchool: true
|
||||||
|
})
|
||||||
if (data.schoolList) {
|
if (data.schoolList) {
|
||||||
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||||
}
|
}
|
||||||
@@ -361,7 +366,7 @@ function handleClickSchool(item) {
|
|||||||
function createMarkersInMap() {
|
function createMarkersInMap() {
|
||||||
for (let i = 0; i < tableData.value.length; i++) {
|
for (let i = 0; i < tableData.value.length; i++) {
|
||||||
const element = tableData.value[i]
|
const element = tableData.value[i]
|
||||||
if (!element.schoolShow || !element.showInMap) {
|
if (!element.schoolShow || !element.showInMap || element.status == 1) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const markerIcon = flagMap[element.flagColor || 'red']
|
const markerIcon = flagMap[element.flagColor || 'red']
|
||||||
@@ -389,7 +394,7 @@ function handleInsertPlace(schoolId) {
|
|||||||
lng: undefined,
|
lng: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
address: undefined,
|
address: undefined,
|
||||||
remark: undefined,
|
introduce: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
schoolId: schoolId,
|
schoolId: schoolId,
|
||||||
showInMap: true,
|
showInMap: true,
|
||||||
@@ -531,11 +536,22 @@ function closePlaceList() {
|
|||||||
fullScreenPlaceList.value = false
|
fullScreenPlaceList.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changePlaceStatus() {
|
async function changePlaceStatus(row) {
|
||||||
// const resp = await updatePlace(item);
|
try {
|
||||||
// if (resp.code == 200) {
|
// 修改状态的二次确认
|
||||||
|
const text = row.status == 0 ? '启用' : '停用'
|
||||||
|
await message.confirm('确认要"' + text + '""' + row.name + '"场地吗?')
|
||||||
|
// 发起修改状态
|
||||||
|
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
|
||||||
|
message.success('修改成功')
|
||||||
|
// 刷新列表
|
||||||
|
// await getPageData()
|
||||||
|
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
|
||||||
resetMarkers()
|
resetMarkers()
|
||||||
// }
|
} catch {
|
||||||
|
// 取消后,进行恢复按钮
|
||||||
|
row.status = row.status == 0 ? 1 : 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const isRanging = ref(false)
|
// const isRanging = ref(false)
|
||||||
@@ -544,7 +560,7 @@ const placeForm = ref({
|
|||||||
lng: undefined,
|
lng: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
address: undefined,
|
address: undefined,
|
||||||
remark: undefined,
|
introduce: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
flagColor: 'red'
|
flagColor: 'red'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ async function changeStatus(row) {
|
|||||||
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
||||||
await message.confirm('确认要"' + text + '""' + row.schoolName + '"驾校吗?')
|
await message.confirm('确认要"' + text + '""' + row.schoolName + '"驾校吗?')
|
||||||
// 发起修改状态
|
// 发起修改状态
|
||||||
await api.updateSchoolStatus(row.id, row.status)
|
await api.updateSchoolStatus(row.schoolId, row.status)
|
||||||
|
message.success('修改成功')
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user