salary
qsh 5 months ago
parent 18ed17b131
commit d31f4b4f8b
  1. 22
      src/api/clue/settle.js
  2. 5
      src/components/Form/src/Form.vue
  3. 2
      src/utils/index.ts
  4. 9
      src/views/Basic/Role/RoleDataPermissionForm.vue
  5. 100
      src/views/Clue/Order/Comp/MallSettle.vue
  6. 72
      src/views/Clue/Order/Comp/SchoolSettle.vue
  7. 19
      src/views/Clue/Pool/Comp/DialogClue.vue

@ -1,13 +1,23 @@
import request from '@/config/axios'
// 查询列表
export const getSettlePage = async (params) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/page', params })
// 查询招生结算列表
export const getSchoolSettlePage = async (params) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/page', params })
}
// 查询详情
export const getSettle = async (id) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/get?id=' + id })
// 查询招生结算详情
export const getSchoolSettleDetail = async (id) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/get?id=' + id })
}
// 查询进销存结算列表
export const getMallSettlePage = async (params) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/page', params })
}
// 查询进销存结算详情
export const getMallSettleDetail = async (id) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/get?id=' + id })
}
// 批量结算

@ -78,7 +78,10 @@ export default defineComponent({
})
//
const setValues = (data: Recordable = {}) => {
const setValues = (data: Recordable = {}, isReset: Boolean = false) => {
if (isReset) {
formModel.value = initModel(unref(getProps).schema, unref(formModel))
}
formModel.value = Object.assign(unref(formModel), data)
}

@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
export const removeNullField = (obj: Object) => {
for (const key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
if (obj[key] == '') {
if (obj[key] === '') {
delete obj[key]
}
}

@ -107,7 +107,14 @@ const dataScopeOptions = [
]
async function getRoleInfo(id) {
formData.value = await RoleApi.getRole(id)
try {
formData.value = await RoleApi.getRole(id)
nextTick(() => {
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
})
} catch (error) {
console.log(error)
}
}
/** 提交表单 */

@ -11,9 +11,9 @@
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.settleType" placeholder="结算类型" clearable filterable>
<el-option label="报名费" :value="1" />
<el-option label="其他支出" :value="2" />
<el-select v-model="searchForm.settlementType" placeholder="结算类型" clearable filterable>
<el-option label="货款" value="货款" />
<el-option label="其他支出" value="其他支出" />
</el-select>
</el-form-item>
<el-form-item>
@ -39,11 +39,11 @@
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.productId"
v-model="searchForm.signProduct"
placeholder="选择成交产品"
filterable
clearable
@change="searchForm.specsId = undefined"
@change="searchForm.signSpecs = undefined"
>
<el-option
v-for="item in prodOptions"
@ -55,14 +55,14 @@
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.specsId"
v-model="searchForm.signSpecs"
placeholder="选择规格"
filterable
clearable
:disabled="!searchForm.productId"
:disabled="!searchForm.signProduct"
>
<el-option
v-for="item in specsOptions(searchForm.productId)"
v-for="item in specsOptions(searchForm.signProduct)"
:key="item.specsId"
:label="item.specsName"
:value="item.specsId"
@ -80,9 +80,9 @@
</el-select>
</el-form-item>
<el-form-item>
<el-radio-group v-model="searchForm.settleStatus">
<el-radio-group v-model="searchForm.settlementState">
<el-radio :label="1"> 已结算 </el-radio>
<el-radio :label="2"> 结算 </el-radio>
<el-radio :label="0"> 结算 </el-radio>
</el-radio-group>
</el-form-item>
@ -101,38 +101,42 @@
:summary-method="getSummaries"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="60" />
<el-table-column
type="selection"
width="60"
fixed="left"
:selectable="(row) => row.settlementState == '待结算'"
/>
<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="productName" label="成交产品" min-width="150px" />
<el-table-column prop="specsName" label="成交规格" min-width="150px" />
<el-table-column prop="signNum" label="成交数量" min-width="150px" />
<el-table-column prop="" label="供应商" min-width="150px" />
<el-table-column prop="signClass" label="结算单价" min-width="150px" />
<el-table-column prop="settleNum" label="结算数量" min-width="150px" />
<el-table-column prop="settleAmount" label="结算金额" min-width="150px" />
<el-table-column prop="signProduct" label="成交产品" min-width="150px" />
<el-table-column prop="signSpecs" label="成交规格" min-width="150px" />
<el-table-column prop="supplier" label="供应商" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
<el-table-column label="费用备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.feeRemark">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="scope.row.feeRemark"></div>
<div v-dompurify-html="scope.row.extraRemark"></div>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop="settleTime"
prop="settlementDate"
label="结算时间"
width="120px"
:formatter="dateFormatter"
/>
<el-table-column prop="settleUser" label="结算人" min-width="90px" />
<el-table-column prop="settleType" label="结算类型" width="90px" fixed="right" />
<el-table-column prop="settleStatus" label="结算状态" width="90px" fixed="right" />
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
<el-table-column label="结算备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
@ -152,6 +156,9 @@
/>
<el-dialog title="批量结算" v-model="showDailog" width="600px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
<el-form-item label="结算金额">
{{ settleAmount }}
</el-form-item>
<el-form-item label="结算备注" prop="remark">
<Editor v-model:modelValue="form.remark" />
</el-form-item>
@ -168,12 +175,13 @@
</div>
</template>
<script setup name="SchoolSettle">
<script setup name="MallSettle">
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { getSimpleProductList } from '@/api/mall/product'
import * as SettleApi from '@/api/clue/settle'
import { getDictOptions } from '@/utils/dict'
import { removeNullField } from '@/utils/index'
import { dateFormatter } from '@/utils/formatTime'
const message = useMessage() //
@ -188,12 +196,11 @@ const searchForm = ref({
phone: undefined,
signUser: undefined,
dealDate: [],
productId: undefined,
specsId: undefined,
signClass: undefined,
signProduct: undefined,
signSpecs: undefined,
signId: undefined,
settleStatus: 2,
settleType: undefined,
settlementState: 0,
settlementType: undefined,
supplier: undefined,
pageSize: 20,
pageNo: 1
@ -205,13 +212,12 @@ function handleReset() {
phone: undefined,
signUser: undefined,
dealDate: [],
signSchool: undefined,
signPlace: undefined,
signClass: undefined,
signProduct: undefined,
signSpecs: undefined,
signId: undefined,
settleType: undefined,
settlementState: 0,
settlementType: undefined,
supplier: undefined,
settleStatus: 2,
pageSize: 20,
pageNo: 1
}
@ -225,12 +231,16 @@ function handleSearch() {
const loading = ref(false)
const tableList = ref([])
const total = ref(0)
const totalNum = ref(0)
const totalAmount = ref(0)
async function getList() {
loading.value = true
try {
const data = await SettleApi.getSettlePage(searchForm.value)
const data = await SettleApi.getMallSettlePage(removeNullField(searchForm.value))
tableList.value = data.list
total.value = data.total
totalNum.value = data.totalNum
totalAmount.value = data.totalAmount
} finally {
loading.value = false
}
@ -243,9 +253,9 @@ function getSummaries(param) {
if (index === 0) {
sums[index] = '合计'
} else if (column.property == 'settleNum') {
sums[index] = 123
sums[index] = totalNum.value
} else if (column.property == 'settleAmount') {
sums[index] = 54321
sums[index] = totalAmount.value
} else {
sums[index] = ''
}
@ -254,9 +264,9 @@ function getSummaries(param) {
return sums
}
const batchIds = ref([])
const selectList = ref([])
function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.id)
selectList.value = [...val]
}
const showDailog = ref(false)
@ -267,13 +277,15 @@ const rules = {
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
}
const settleAmount = ref(0)
function batchSettle() {
if (batchIds.value.length) {
if (selectList.value.length) {
showDailog.value = true
form.value = {
signIds: batchIds.value,
settlementIds: selectList.value.map((it) => it.settlementId),
reamrk: undefined
}
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
} else {
message.info('请选择表格数据!')
}
@ -281,12 +293,12 @@ function batchSettle() {
async function handleSaveSettle() {
if (!formRef.value) return
const valid = await formRef.value.getElFormRef().validate()
const valid = await formRef.value.validate()
if (!valid) return
try {
formLoading.value = true
await SettleApi.batchSaveSettle(form.value)
message.success(data)
message.success('结算成功')
showDailog.value = false
getList()
} finally {

@ -11,9 +11,9 @@
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.settleType" placeholder="结算类型" clearable filterable>
<el-option label="报名费" :value="1" />
<el-option label="其他支出" :value="2" />
<el-select v-model="searchForm.settlementType" placeholder="结算类型" clearable filterable>
<el-option label="报名费" value="报名费" />
<el-option label="其他支出" value="其他支出" />
</el-select>
</el-form-item>
<el-form-item>
@ -87,9 +87,9 @@
</el-select>
</el-form-item>
<el-form-item>
<el-radio-group v-model="searchForm.settleStatus">
<el-radio-group v-model="searchForm.settlementState">
<el-radio :label="1"> 已结算 </el-radio>
<el-radio :label="2"> 结算 </el-radio>
<el-radio :label="0"> 结算 </el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
@ -107,7 +107,12 @@
:summary-method="getSummaries"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="60" />
<el-table-column
type="selection"
width="60"
fixed="left"
:selectable="(row) => row.settlementState == '待结算'"
/>
<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" />
@ -116,28 +121,28 @@
<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="signClass" label="结算单价" min-width="150px" />
<el-table-column prop="settleNum" label="结算数量" min-width="150px" />
<el-table-column prop="settleAmount" label="结算金额" min-width="150px" />
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
<el-table-column label="费用备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.feeRemark">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="scope.row.feeRemark"></div>
<div v-dompurify-html="scope.row.extraRemark"></div>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop="settleTime"
prop="settlementDate"
label="结算时间"
width="120px"
:formatter="dateFormatter"
/>
<el-table-column prop="settleUser" label="结算人" min-width="90px" />
<el-table-column prop="settleType" label="结算类型" width="90px" fixed="right" />
<el-table-column prop="settleStatus" label="结算状态" width="90px" fixed="right" />
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
<el-table-column label="结算备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
@ -158,6 +163,9 @@
<el-dialog title="批量结算" v-model="showDailog" width="600px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
<el-form-item label="结算金额">
{{ settleAmount }}
</el-form-item>
<el-form-item label="结算备注" prop="remark">
<Editor v-model:modelValue="form.remark" />
</el-form-item>
@ -181,6 +189,7 @@ import { getClassTypeList } from '@/api/school/class'
import * as SettleApi from '@/api/clue/settle'
import { dateFormatter } from '@/utils/formatTime'
import { removeNullField } from '@/utils/index'
const message = useMessage() //
@ -198,8 +207,8 @@ const searchForm = ref({
signPlace: undefined,
signClass: undefined,
signId: undefined,
settleType: undefined,
settleStatus: 2,
settlementType: undefined,
settlementState: 0,
pageSize: 20,
pageNo: 1
})
@ -214,8 +223,8 @@ function handleReset() {
signPlace: undefined,
signClass: undefined,
signId: undefined,
settleType: undefined,
settleStatus: 2,
settlementType: undefined,
settlementState: 0,
pageSize: 20,
pageNo: 1
}
@ -229,12 +238,17 @@ function handleSearch() {
const loading = ref(false)
const tableList = ref([])
const total = ref(0)
const totalNum = ref(0)
const totalAmount = ref(0)
async function getList() {
loading.value = true
try {
const data = await SettleApi.getSettlePage(searchForm.value)
const data = await SettleApi.getSchoolSettlePage(removeNullField(searchForm.value))
tableList.value = data.list
total.value = data.total
totalNum.value = data.totalNum
totalAmount.value = data.totalAmount
} finally {
loading.value = false
}
@ -247,9 +261,9 @@ function getSummaries(param) {
if (index === 0) {
sums[index] = '合计'
} else if (column.property == 'settleNum') {
sums[index] = 123
sums[index] = totalNum.value
} else if (column.property == 'settleAmount') {
sums[index] = 54321
sums[index] = totalAmount.value
} else {
sums[index] = ''
}
@ -258,9 +272,9 @@ function getSummaries(param) {
return sums
}
const batchIds = ref([])
const selectList = ref([])
function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.id)
selectList.value = [...val]
}
const showDailog = ref(false)
@ -271,13 +285,15 @@ const rules = {
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
}
const settleAmount = ref(0)
function batchSettle() {
if (batchIds.value.length) {
if (selectList.value.length) {
showDailog.value = true
form.value = {
signIds: batchIds.value,
settlementIds: selectList.value.map((it) => it.settlementId),
reamrk: undefined
}
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
} else {
message.info('请选择表格数据!')
}
@ -285,12 +301,12 @@ function batchSettle() {
async function handleSaveSettle() {
if (!formRef.value) return
const valid = await formRef.value.getElFormRef().validate()
const valid = await formRef.value.validate()
if (!valid) return
try {
formLoading.value = true
await SettleApi.batchSaveSettle(form.value)
message.success(data)
message.success('结算成功')
showDailog.value = false
getList()
} finally {

@ -232,6 +232,7 @@ const open = async (type, id) => {
try {
const data = await ClueApi.getClue(id)
info.value = { ...data, ...data.diyParams }
info.value.remark = info.value.remark || ''
defaultLatLng.value = {
lat: data.lat,
lng: data.lng
@ -239,7 +240,7 @@ const open = async (type, id) => {
nextTick(() => {
followList.value = data.followUser
address.value = data.address || ''
formRef.value.setValues(info.value)
formRef.value.setValues(info.value, false)
})
} finally {
formLoading.value = false
@ -259,7 +260,7 @@ const open = async (type, id) => {
lng: 117.283042
}
nextTick(() => {
formRef.value.setValues(info.value)
formRef.value.setValues(info.value, true)
})
}
}
@ -281,12 +282,14 @@ function changeTab() {
defineExpose({ open }) // open
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 = {}
info.value = {
address: undefined,
lat: undefined,
lng: undefined,
consultTime: formatDate(new Date()),
followUsers: [],
diyParams: {}
}
}
const placeList = ref([])

Loading…
Cancel
Save