Compare commits
5 Commits
8f1b89cc91
...
e3e24f4939
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e24f4939 | ||
|
|
f2064d99ad | ||
|
|
08ada50d1a | ||
|
|
ab0c770167 | ||
|
|
e1ff8213bf |
@@ -59,6 +59,11 @@ const usedSchema = ref([])
|
||||
|
||||
const newSchema = computed(() => {
|
||||
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)) {
|
||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||
if (index > -1) {
|
||||
|
||||
@@ -108,9 +108,11 @@ const aftersaleList = ref([])
|
||||
const extraPayList = ref([])
|
||||
|
||||
const prodTotalPrice = computed(() => {
|
||||
return orderInfo.value.signProducts.reduce(
|
||||
return (
|
||||
orderInfo.value.signProducts?.reduce(
|
||||
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||
0
|
||||
) || 0
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@@ -67,9 +67,10 @@
|
||||
<div class="p-10px flex justify-center">
|
||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px" />
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
@@ -205,6 +206,15 @@ import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
@@ -337,15 +347,6 @@ const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -182,6 +182,15 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
@@ -322,20 +331,11 @@ async function getClassTypeOptions() {
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
236
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
236
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.dealDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signSchool"
|
||||
placeholder="选择驾校"
|
||||
filterable
|
||||
clearable
|
||||
@change="changeSchool"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in schoolOptions"
|
||||
:key="item.schoolId"
|
||||
:label="item.schoolName"
|
||||
:value="item.schoolId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signPlace"
|
||||
placeholder="选择场地"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signSchool"
|
||||
@change="changePlace"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in placeOptions"
|
||||
:key="item.placeId"
|
||||
:label="item.name"
|
||||
:value="item.placeId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signClass"
|
||||
:disabled="!searchForm.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
:key="item.typeId"
|
||||
:label="item.typeName"
|
||||
:value="item.typeId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settleStatus">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="2"> 未结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="登记时间" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="signSchool" label="成交驾校" min-width="150px" />
|
||||
<el-table-column prop="signPlace" label="成交场地" min-width="150px" />
|
||||
<el-table-column prop="signClass" label="成交班型" min-width="150px" />
|
||||
<el-table-column prop="settleTime" label="结算时间" width="120px" />
|
||||
<el-table-column prop="settleUser" label="结算人" min-width="90px" />
|
||||
<el-table-column prop="settleStatus" label="结算状态" width="90px" />
|
||||
<el-table-column 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.settleRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SchoolSettle">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settleStatus: 2,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settleStatus: 2,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await DeliveryApi.getDeliveryPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.id)
|
||||
}
|
||||
|
||||
function batchSettle() {}
|
||||
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = ref([])
|
||||
const userOptions = ref([])
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
|
||||
})
|
||||
|
||||
function changeSchool() {
|
||||
searchForm.value.signPlace = undefined
|
||||
searchForm.value.signClass = undefined
|
||||
}
|
||||
|
||||
function changePlace() {
|
||||
searchForm.value.signClass = undefined
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
const classOptions = ref([])
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
14
src/views/Clue/Order/Comp/Settle.vue
Normal file
14
src/views/Clue/Order/Comp/Settle.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<SchoolSettle v-if="appStore.getAppInfo?.instanceType == 1" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Settle">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import SchoolSettle from './SchoolSettle.vue'
|
||||
|
||||
const appStore = useAppStore()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -15,6 +15,9 @@
|
||||
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<Delivery v-if="tabName == 'delivery'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="对外结算" name="settle">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
@@ -25,6 +28,7 @@ import MallOrderList from './Comp/MallOrderList.vue'
|
||||
import Reback from './Comp/Reback.vue'
|
||||
import AfterSales from './Comp/AfterSales.vue'
|
||||
import Delivery from './Comp/Delivery.vue'
|
||||
import Settle from './Comp/Settle.vue'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const tabName = ref('list')
|
||||
|
||||
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,6 +1,6 @@
|
||||
<template>
|
||||
<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">
|
||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||
</el-tab-pane>
|
||||
@@ -41,6 +41,8 @@
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
v-model="row.content"
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 2 }"
|
||||
placeholder="输入跟进内容"
|
||||
:disabled="!row.editable"
|
||||
/>
|
||||
@@ -60,18 +62,15 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||
<div class="flex justify-between items-center">
|
||||
<el-select
|
||||
<el-autocomplete
|
||||
v-model="areaValue"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
style="width: 250px"
|
||||
reserve-keyword
|
||||
placeholder="输入并搜索位置"
|
||||
:remote-method="remoteMethod"
|
||||
@change="currentSelect"
|
||||
:fetch-suggestions="remoteMethod"
|
||||
@select="currentSelect"
|
||||
>
|
||||
<el-option
|
||||
<!-- <el-option
|
||||
v-for="item in areaList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
@@ -80,8 +79,8 @@
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-option> -->
|
||||
</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 />
|
||||
@@ -119,18 +118,17 @@
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
<template #footer>
|
||||
<span>
|
||||
<div style="position: absolute; top: 75px; right: 20px">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogClue">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||
@@ -139,7 +137,7 @@ import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
|
||||
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
|
||||
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 FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -148,7 +146,6 @@ import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
||||
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
@@ -161,8 +158,14 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const formSchema = computed(() => {
|
||||
const newSchema = [...props.schema]
|
||||
newSchema.forEach((it) => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
}
|
||||
})
|
||||
return [
|
||||
...props.schema,
|
||||
...newSchema,
|
||||
{
|
||||
component: 'Input',
|
||||
label: '诉求',
|
||||
@@ -185,6 +188,10 @@ const formSchema = computed(() => {
|
||||
]
|
||||
})
|
||||
|
||||
const dateAfterToday = (t) => {
|
||||
return t.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -204,7 +211,6 @@ const tabName = ref('info')
|
||||
const followList = ref([])
|
||||
|
||||
const areaValue = ref('')
|
||||
const areaList = ref([])
|
||||
const address = ref('')
|
||||
const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
@@ -235,20 +241,37 @@ const open = async (type, id) => {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else {
|
||||
followList.value = []
|
||||
followList.value = [
|
||||
{
|
||||
userId: useUserStore().getUser.id,
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
editable: true
|
||||
}
|
||||
]
|
||||
address.value = ''
|
||||
defaultLatLng.value = {
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
}
|
||||
nextTick(() => {
|
||||
formRef.value.setValues(info.value)
|
||||
})
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
}
|
||||
|
||||
function changeTab() {
|
||||
if (tabName.value == 'map') {
|
||||
if (!dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
remoteMethod(address.value)
|
||||
// remoteMethod(address.value)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
destroyMap()
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
@@ -257,14 +280,15 @@ function resetForm() {
|
||||
info.value.address = undefined
|
||||
info.value.lat = undefined
|
||||
info.value.lng = undefined
|
||||
info.value.consultTime = formatDate(new Date())
|
||||
info.value.followUsers = []
|
||||
info.value.diyParams = {}
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList()
|
||||
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0)
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
@@ -274,7 +298,7 @@ async function handleSave() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.getElFormRef().validate()
|
||||
if (!valid) return
|
||||
if (!followList.value && followList.value.length == 0) {
|
||||
if (!followList.value || followList.value.length == 0) {
|
||||
message.info('请添加跟进人')
|
||||
return
|
||||
}
|
||||
@@ -303,11 +327,11 @@ async function handleSave() {
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClueApi.createClue(params)
|
||||
message.success(t('common.createSuccess'))
|
||||
const data = await ClueApi.createClue(params)
|
||||
message.success(data)
|
||||
} else {
|
||||
await ClueApi.updateClue(params)
|
||||
message.success(t('common.updateSuccess'))
|
||||
const data = await ClueApi.updateClue(params)
|
||||
message.success(data)
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@@ -353,11 +377,9 @@ function initMap(data) {
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
if (data.lng || data.lat) {
|
||||
addmark(data.lng, data.lat, AMap)
|
||||
}
|
||||
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '全国'
|
||||
city: '合肥'
|
||||
})
|
||||
geoCoder.value = new AMap.Geocoder()
|
||||
dialogMap.value.on('click', (e) => {
|
||||
@@ -459,10 +481,11 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
dialogMap.value.setCenter([lat, lng], true)
|
||||
getNearbySchool({ lat: lng, lng: lat })
|
||||
}
|
||||
function removeMarker() {
|
||||
@@ -508,28 +531,33 @@ function showSchoolInfo(val) {
|
||||
schoolInfoDialog.value.open(val)
|
||||
}
|
||||
|
||||
function remoteMethod(searchValue) {
|
||||
if (searchValue !== '') {
|
||||
setTimeout(() => {
|
||||
function remoteMethod(searchValue, cb) {
|
||||
if (searchValue) {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
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) {
|
||||
const area = areaList.value.find((it) => it.name == val)
|
||||
if (area) {
|
||||
if (val) {
|
||||
defaultLatLng.value = {
|
||||
lng: area.location?.lng,
|
||||
lat: area.location?.lat
|
||||
lng: val.location?.lng,
|
||||
lat: val.location?.lat
|
||||
}
|
||||
addmark(area.location?.lng, area.location?.lat, aMap.value)
|
||||
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500)
|
||||
regeoCode(area.location?.lng, area.location?.lat)
|
||||
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||
regeoCode(val.location?.lng, val.location?.lat)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -90,6 +91,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="公司收款" prop="isCompanyReceipts">
|
||||
<el-radio-group v-model="form.isCompanyReceipts">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="8"
|
||||
:offset="0"
|
||||
@@ -368,6 +377,7 @@ function resetForm(id) {
|
||||
state: true,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
extraPay: [],
|
||||
signProducts: []
|
||||
}
|
||||
@@ -445,7 +455,7 @@ async function getClassTypeOptions() {
|
||||
function getOptions() {
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
@@ -476,6 +486,11 @@ function changePlace() {
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
form.value.payAmount =
|
||||
classOptions.value.find((it) => (it.typeId = form.value.signClass)).guidingPrice || 0
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
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 FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -267,8 +267,8 @@ function followSuccess() {
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList()
|
||||
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0)
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const defaultLatLng = ref({
|
||||
@@ -339,7 +339,8 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<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 name="1">
|
||||
<template #label>
|
||||
@@ -31,6 +31,14 @@
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<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>
|
||||
<div class="absolute" style="right: 10px; top: 0">
|
||||
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
||||
@@ -39,6 +47,7 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="queryType != 5">
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
@@ -143,13 +152,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</template>
|
||||
|
||||
<DialogClue
|
||||
v-if="!loading"
|
||||
ref="formRef"
|
||||
:userOptions="userOptions"
|
||||
:schema="allSchemas.formSchema"
|
||||
@sucess="getTableList"
|
||||
@success="getTableList"
|
||||
/>
|
||||
<DrawerClue
|
||||
v-if="!loading"
|
||||
@@ -164,11 +174,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="CluePool">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { getSimpleFieldList } from '@/api/clue/clueField'
|
||||
import DialogClue from './Comp/DialogClue.vue'
|
||||
import DrawerClue from './Comp/DrawerClue.vue'
|
||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||
import DialogFollow from './Comp/DialogFollow.vue'
|
||||
import ClueMap from './Comp/ClueMap.vue'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
@@ -177,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchRef = ref()
|
||||
const queryType = ref('2')
|
||||
@@ -223,10 +236,24 @@ function getCheckedColumns(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() {
|
||||
searchRef.value.reset()
|
||||
nextTick(() => {
|
||||
searchRef.value && searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
})
|
||||
}
|
||||
|
||||
async function getTableList() {
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<span class="mr-10px">{{ item.username }}</span>
|
||||
<span>已跟进{{ item.followNum }}条线索</span>
|
||||
</li>
|
||||
<br />
|
||||
<!-- <br /> -->
|
||||
<!-- </TransitionGroup> -->
|
||||
</ul>
|
||||
</el-skeleton>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
:options="props.schoolOption"
|
||||
v-model="formData.schPlace"
|
||||
filterable
|
||||
:props="{ value: 'id' }"
|
||||
:props="{ value: 'value' }"
|
||||
show-all-levels
|
||||
style="width: 100%"
|
||||
/>
|
||||
@@ -116,26 +116,26 @@
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitCompanyForm.profitType">
|
||||
<el-radio-group v-model="profitCompanyForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitCompanyForm.profitType == 1">
|
||||
<div class="flex items-center" v-if="profitCompanyForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitCompanyForm.isPlus"
|
||||
v-model="profitCompanyForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" :value="1" />
|
||||
<el-option label="-" :value="2" />
|
||||
<el-option label="+" value="+" />
|
||||
<el-option label="-" value="-" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.bianliang"
|
||||
v-model="profitCompanyForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -144,7 +144,7 @@
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.bili"
|
||||
v-model="profitCompanyForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
@@ -152,11 +152,11 @@
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitCompanyForm.profitType == 2">
|
||||
<div v-else-if="profitCompanyForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="profitCompanyForm.dangwei.push({ dangweizhi: undefined, lirun: undefined })"
|
||||
@click="profitCompanyForm.dangwei.push({ signPrice: undefined, profit: undefined })"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
@@ -166,7 +166,7 @@
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.dangweizhi"
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -176,7 +176,7 @@
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.lirun"
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -197,16 +197,16 @@
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitEmployeeForm.profitType">
|
||||
<el-radio-group v-model="profitEmployeeForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitType == 1">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitEmployeeForm.isPlus"
|
||||
v-model="profitEmployeeForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
@@ -216,7 +216,7 @@
|
||||
<el-option label="-" :value="2" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.bianliang"
|
||||
v-model="profitEmployeeForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -225,7 +225,7 @@
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.bili"
|
||||
v-model="profitEmployeeForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
@@ -233,12 +233,12 @@
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitEmployeeForm.profitType == 2">
|
||||
<div v-else-if="profitEmployeeForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
profitEmployeeForm.dangwei.push({ dangweizhi: undefined, lirun: undefined })
|
||||
profitEmployeeForm.dangwei.push({ signPrice: undefined, profit: undefined })
|
||||
"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
@@ -249,7 +249,7 @@
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.dangweizhi"
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -259,7 +259,7 @@
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.lirun"
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -451,15 +451,17 @@ const formRef = ref() // 表单 Ref
|
||||
const currentTab = ref('base')
|
||||
|
||||
const profitCompanyForm = ref({
|
||||
profitType: 1,
|
||||
dangwei: []
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitCompanyRules = {}
|
||||
const profitCompanyRef = ref()
|
||||
|
||||
const profitEmployeeForm = ref({
|
||||
profitType: 1,
|
||||
dangwei: []
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitEmployeeRules = {}
|
||||
const profitEmployeeRef = ref()
|
||||
@@ -476,6 +478,7 @@ const open = async (type, id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
||||
formType.value = type
|
||||
currentTab.value = 'base'
|
||||
resetForm()
|
||||
if (!opts.value.length) {
|
||||
const arr = await ClassApi.getCommissionParams()
|
||||
@@ -489,6 +492,37 @@ const open = async (type, id) => {
|
||||
try {
|
||||
formData.value = await ClassApi.getClassType(id)
|
||||
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
|
||||
if (!formData.value.companyProfitVO) {
|
||||
profitCompanyForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.companyProfitVO.profitMode == 1) {
|
||||
profitCompanyForm.value = { ...formData.value.companyProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitCompanyForm.value = {
|
||||
...formData.value.companyProfitVO,
|
||||
dangwei: formData.value.companyProfitVO.profitRule
|
||||
}
|
||||
profitCompanyForm.value.profitRule = {}
|
||||
}
|
||||
|
||||
if (!formData.value.personProfitVO) {
|
||||
profitEmployeeForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.personProfitVO.profitMode == 1) {
|
||||
profitEmployeeForm.value = { ...formData.value.personProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitEmployeeForm.value = {
|
||||
...formData.value.personProfitVO,
|
||||
dangwei: formData.value.personProfitVO.profitRule
|
||||
}
|
||||
profitEmployeeForm.value.profitRule = {}
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -579,6 +613,51 @@ async function submitForm() {
|
||||
delete data.schPlace
|
||||
delete data.percentages
|
||||
data.percentages = { ...comissionForm.value }
|
||||
data.companyProfitVO = { ...profitCompanyForm.value }
|
||||
data.personProfitVO = { ...profitEmployeeForm.value }
|
||||
if (data.companyProfitVO.profitMode == 1) {
|
||||
data.companyProfitVO.profitRule.minPrice = data.companyProfitVO.profitRule.minPrice || 0
|
||||
if (!data.companyProfitVO.profitRule.mark || !data.companyProfitVO.profitRule.rate) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.companyProfitVO.profitRule = data.companyProfitVO?.dangwei || []
|
||||
delete data.companyProfitVO.dangwei
|
||||
if (data.companyProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加公司利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.companyProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (data.personProfitVO.profitMode == 1) {
|
||||
data.personProfitVO.profitRule.minPrice = data.personProfitVO.profitRule.minPrice || 0
|
||||
if (!data.personProfitVO.profitRule.mark || !data.personProfitVO.profitRule.rate) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.personProfitVO.profitRule = data.personProfitVO?.dangwei || []
|
||||
delete data.personProfitVO.dangwei
|
||||
if (data.personProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加员工利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.personProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClassApi.createClassType(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="handleBatchDelete"
|
||||
@click="handleBatchDelete([])"
|
||||
v-hasPermi="['school:class:batch-delete']"
|
||||
>批量删除</el-button
|
||||
>
|
||||
@@ -82,7 +82,13 @@
|
||||
/>
|
||||
<el-table-column label="备注" width="260">
|
||||
<template #default="{ row }">
|
||||
<!-- <div v-dompurify-html="row.remark"></div> -->
|
||||
<el-popover placement="top" width="500px" trigger="click">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
@@ -154,6 +160,7 @@ import DialogClass from './Comp/DialogClass.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -175,7 +182,11 @@ const schoolOption = ref([])
|
||||
|
||||
async function getSchoolList() {
|
||||
try {
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
schoolOption.value = data.schoolList.map((item) => ({
|
||||
value: item.schoolId,
|
||||
label: item.schoolName,
|
||||
@@ -194,8 +205,7 @@ const columns = [
|
||||
{ props: 'placeName', label: '场地' },
|
||||
{ props: 'typeName', label: '班型名称' },
|
||||
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' },
|
||||
{ props: 'minPrice', label: '最新底价', width: '100px' }
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' }
|
||||
// { props: 'remark', label: '备注', width: '100px' }
|
||||
]
|
||||
|
||||
@@ -215,7 +225,7 @@ async function getList() {
|
||||
}
|
||||
}
|
||||
delete params.schPlace
|
||||
const data = await ClassApi.getClassTypePage(params)
|
||||
const data = await ClassApi.getClassTypePage(removeNullField(params))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -240,7 +250,7 @@ function handleReset() {
|
||||
}
|
||||
|
||||
async function handleBatchDelete(arr = []) {
|
||||
if (!arr.length || !selectRows.value.length) {
|
||||
if (!arr.length && !selectRows.value.length) {
|
||||
message.info('请选择表格行!')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -325,7 +325,10 @@ function regeoCode() {
|
||||
async function getPageData() {
|
||||
schoolList.value = []
|
||||
tableData.value = []
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
if (data.schoolList) {
|
||||
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||
}
|
||||
@@ -363,7 +366,7 @@ function handleClickSchool(item) {
|
||||
function createMarkersInMap() {
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
const element = tableData.value[i]
|
||||
if (!element.schoolShow || !element.showInMap) {
|
||||
if (!element.schoolShow || !element.showInMap || element.status == 1) {
|
||||
continue
|
||||
}
|
||||
const markerIcon = flagMap[element.flagColor || 'red']
|
||||
@@ -542,7 +545,8 @@ async function changePlaceStatus(row) {
|
||||
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
// await getList()
|
||||
// await getPageData()
|
||||
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
|
||||
resetMarkers()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
|
||||
Reference in New Issue
Block a user