Merge pull request '工资条' (#1) from salary into main
Reviewed-on: http://114.55.169.15:3000/qiushanhe/ss-crm-manage-web/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
@@ -4,12 +4,12 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
# VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
|
||||
# 上传路径
|
||||
# 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_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
|
||||
|
||||
@@ -12,7 +12,11 @@ export const getAfterSalePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/create', data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-after-sale/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
@@ -12,7 +12,7 @@ export const getDeliveryPage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createDelivery = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data })
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
|
||||
@@ -7,7 +7,11 @@ export const getFollowList = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createFollow = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/clue-follow-record/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/clue-follow-record/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getClue = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClue = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-clue/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -12,7 +12,11 @@ export const getPaymentPage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/create', data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-pay-record/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
26
src/api/clue/settle.js
Normal file
26
src/api/clue/settle.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询招生结算列表
|
||||
export const getSchoolSettlePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/page', params })
|
||||
}
|
||||
|
||||
// 查询招生结算详情
|
||||
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 })
|
||||
}
|
||||
|
||||
// 批量结算
|
||||
export const batchSaveSettle = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-settlement/batch/save', data })
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export const getSign = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSign = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
|
||||
@@ -7,7 +7,7 @@ export const getSkillPage = (params) => {
|
||||
|
||||
// 创建
|
||||
export const createSkill = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data })
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getSource = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSource = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface BrandVO {
|
||||
|
||||
// 创建商品品牌
|
||||
export const createBrand = (data: BrandVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data })
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新商品品牌
|
||||
|
||||
@@ -36,7 +36,11 @@ export interface CategoryVO {
|
||||
|
||||
// 创建商品分类
|
||||
export const createCategory = (data: CategoryVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-category/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-category/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新商品分类
|
||||
|
||||
@@ -11,7 +11,11 @@ export const getProduct = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createProduct = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-product/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-product/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -2,7 +2,11 @@ import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/param/create',
|
||||
data: { ...data, module: 3 },
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -42,7 +42,11 @@ export interface PropertyValueDetailVO {
|
||||
|
||||
// 创建属性项
|
||||
export const createProperty = (data: PropertyVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-property/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-property/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新属性项
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getPurchasePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPurchase = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-purchase/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getWarehousePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createWarehouse = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-warehouse/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -5,6 +5,10 @@ export const getClassTypePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
||||
}
|
||||
|
||||
export const getClassTypeList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getClassType = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||
@@ -12,7 +16,11 @@ export const getClassType = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClassType = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-class-type/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -22,7 +30,7 @@ export const updateClassType = async (params) => {
|
||||
|
||||
// 删除
|
||||
export const deleteClassType = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getPlace = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createPlace = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-place/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -11,7 +11,11 @@ export const getSchool = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSchool = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-school/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-school/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,10 +5,11 @@ import { config } from './config'
|
||||
const { default_headers } = config
|
||||
|
||||
const request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType } = option
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
isSubmitForm,
|
||||
params,
|
||||
data,
|
||||
responseType: responseType,
|
||||
|
||||
@@ -21,6 +21,7 @@ import errorCode from './errorCode'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { result_code, base_url, request_timeout } = config
|
||||
|
||||
@@ -62,15 +63,11 @@ service.interceptors.request.use(
|
||||
}
|
||||
// 设置租户
|
||||
const tenantId = getTenantId()
|
||||
if (tenantId) {
|
||||
;(config as Recordable).headers['tenant-id'] = tenantId
|
||||
}
|
||||
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
|
||||
|
||||
// 设置实例
|
||||
const appId = getAppId()
|
||||
if (appId) {
|
||||
;(config as Recordable).headers['instance-id'] = appId
|
||||
}
|
||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
@@ -83,27 +80,39 @@ service.interceptors.request.use(
|
||||
}
|
||||
// get参数编码
|
||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||
let url = config.url + '?'
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
if (value !== void 0 && value !== null && typeof value !== 'undefined') {
|
||||
if (typeof value === 'object') {
|
||||
for (const val of Object.keys(value)) {
|
||||
const params = propName + '[' + val + ']'
|
||||
const subPart = encodeURIComponent(params) + '='
|
||||
url += subPart + encodeURIComponent(value[val]) + '&'
|
||||
}
|
||||
} else {
|
||||
url += `${propName}=${encodeURIComponent(value)}&`
|
||||
}
|
||||
}
|
||||
}
|
||||
// 给 get 请求加上时间戳参数,避免从缓存中拿数据
|
||||
// const now = new Date().getTime()
|
||||
// params = params.substring(0, url.length - 1) + `?_t=${now}`
|
||||
url = url.slice(0, -1)
|
||||
config.params = {}
|
||||
config.url = url
|
||||
const paramsStr = qs.stringify(params, { allowDots: true })
|
||||
if (paramsStr) {
|
||||
config.url = config.url + '?' + paramsStr
|
||||
}
|
||||
}
|
||||
// 是否提交表单型的接口,如果是,不要频繁调接口
|
||||
if (config?.isSubmitForm) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
time: new Date().getTime()
|
||||
}
|
||||
const sessionObj = cache.session.get('sessionObj')
|
||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url // 请求地址
|
||||
const s_data = sessionObj.data // 请求数据
|
||||
const s_time = sessionObj.time // 请求时间
|
||||
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (
|
||||
s_data === requestObj.data &&
|
||||
requestObj.time - s_time < interval &&
|
||||
s_url === requestObj.url
|
||||
) {
|
||||
const message = '数据正在处理,请勿重复提交'
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
||||
@@ -16,7 +16,9 @@ import { useWatermark } from '@/hooks/web/useWatermark'
|
||||
|
||||
const { setWatermark } = useWatermark()
|
||||
|
||||
nextTick(() => {
|
||||
setWatermark('安徽莳松科技有限公司')
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -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) {
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
nextTick(() => {
|
||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -79,9 +79,19 @@
|
||||
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
||||
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
||||
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -132,6 +142,8 @@ import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const afterSaleAuditDialog = ref()
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -71,7 +71,7 @@
|
||||
<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="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="销售数量" width="90px" />
|
||||
|
||||
@@ -44,7 +44,8 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -75,6 +76,7 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -72,7 +72,7 @@ const applySchema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -44,7 +44,8 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -65,6 +66,7 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -157,6 +157,12 @@ const orderSchema = ref([])
|
||||
function getFields() {
|
||||
getClueFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
@@ -178,6 +184,11 @@ function getFields() {
|
||||
|
||||
getOrderFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.specsId = undefined"
|
||||
>
|
||||
<el-option
|
||||
@@ -29,6 +30,7 @@
|
||||
v-model="searchForm.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
@@ -124,6 +126,9 @@
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240px" fixed="right">
|
||||
@@ -205,6 +210,7 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
|
||||
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<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.settlementType" placeholder="结算类型" clearable filterable>
|
||||
<el-option label="货款" value="货款" />
|
||||
<el-option label="其他支出" value="其他支出" />
|
||||
</el-select>
|
||||
</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.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.signSpecs = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
:key="item.productId"
|
||||
:label="item.productName"
|
||||
:value="item.productId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signSpecs"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.supplier" placeholder="选择供应商" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </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
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<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="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.extraRemark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="settlementDate"
|
||||
label="结算时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<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">
|
||||
<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>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<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>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="showDailog = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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() // 消息弹窗
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
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.getMallSettlePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
selectList.value = [...val]
|
||||
}
|
||||
|
||||
const showDailog = ref(false)
|
||||
const form = ref({})
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
const rules = {
|
||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
||||
}
|
||||
|
||||
const settleAmount = ref(0)
|
||||
function batchSettle() {
|
||||
if (selectList.value.length) {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
} else {
|
||||
message.info('请选择表格数据!')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSaveSettle() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
try {
|
||||
formLoading.value = true
|
||||
await SettleApi.batchSaveSettle(form.value)
|
||||
message.success('结算成功')
|
||||
showDailog.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
const prodOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
|
||||
function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -100,6 +100,9 @@
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -173,7 +176,7 @@ import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
import DialogFeeback from './DialogFeeback.vue'
|
||||
@@ -181,6 +184,7 @@ import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
@@ -325,8 +329,8 @@ function changePlace() {
|
||||
|
||||
const classOptions = ref([])
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -77,9 +77,19 @@
|
||||
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -131,6 +141,8 @@ import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
|
||||
353
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
353
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<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.settlementType" placeholder="结算类型" clearable filterable>
|
||||
<el-option label="报名费" value="报名费" />
|
||||
<el-option label="其他支出" value="其他支出" />
|
||||
</el-select>
|
||||
</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.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </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
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<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="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="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.extraRemark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="settlementDate"
|
||||
label="结算时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<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">
|
||||
<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>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<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>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="showDailog = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SchoolSettle">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
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() // 消息弹窗
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settlementType: undefined,
|
||||
settlementState: 0,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settlementType: undefined,
|
||||
settlementState: 0,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
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.getSchoolSettlePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
selectList.value = [...val]
|
||||
}
|
||||
|
||||
const showDailog = ref(false)
|
||||
const form = ref({})
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
const rules = {
|
||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
||||
}
|
||||
|
||||
const settleAmount = ref(0)
|
||||
function batchSettle() {
|
||||
if (selectList.value.length) {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
} else {
|
||||
message.info('请选择表格数据!')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSaveSettle() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
try {
|
||||
formLoading.value = true
|
||||
await SettleApi.batchSaveSettle(form.value)
|
||||
message.success('结算成功')
|
||||
showDailog.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
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 getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
16
src/views/Clue/Order/Comp/Settle.vue
Normal file
16
src/views/Clue/Order/Comp/Settle.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<SchoolSettle v-if="appStore.getAppInfo?.instanceType == 1" />
|
||||
<MallSettle v-else />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Settle">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import SchoolSettle from './SchoolSettle.vue'
|
||||
import MallSettle from './MallSettle.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" v-if="checkPermi(['clue:order:settle'])">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
@@ -25,6 +28,8 @@ 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'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const tabName = ref('list')
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
// import { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
// import * as MailAccountApi from '@/api/system/mail/account'
|
||||
|
||||
// const userList = await MailAccountApi.getSimpleMailAccountList()
|
||||
const userList = []
|
||||
|
||||
const crudSchemas = reactive([
|
||||
{
|
||||
label: '订单号',
|
||||
field: 'orderNo',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '线索名称',
|
||||
field: 'name',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
field: 'contact',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '线索来源',
|
||||
field: 'resource',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Select',
|
||||
api: () => userList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '跟进人员',
|
||||
field: 'userId',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Select',
|
||||
api: () => userList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '成交时间',
|
||||
field: 'createTime',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
table: {
|
||||
fixed: 'left'
|
||||
},
|
||||
formatter: dateFormatter,
|
||||
detail: {
|
||||
dateFormat: 'YYYY-MM-DD'
|
||||
},
|
||||
search: {
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
startPlaceholder: '创建时间',
|
||||
endPlaceholder: '创建时间'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '是否全款',
|
||||
field: 'isFull',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Radio',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '全款', value: 1 },
|
||||
{ label: '非全款', value: 0 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
@@ -232,10 +232,15 @@ 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
|
||||
}
|
||||
nextTick(() => {
|
||||
followList.value = data.followUser
|
||||
address.value = data.address || ''
|
||||
formRef.value.setValues(info.value)
|
||||
formRef.value.setValues(info.value, false)
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
@@ -255,7 +260,7 @@ const open = async (type, id) => {
|
||||
lng: 117.283042
|
||||
}
|
||||
nextTick(() => {
|
||||
formRef.value.setValues(info.value)
|
||||
formRef.value.setValues(info.value, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -277,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([])
|
||||
|
||||
@@ -10,31 +10,6 @@
|
||||
/>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
v-model="form.dealDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.state">
|
||||
<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">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 驾校招生模式 -->
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-col :span="8" :offset="0">
|
||||
@@ -79,6 +54,7 @@
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -90,6 +66,39 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
v-model="form.dealDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.state">
|
||||
<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">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<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"
|
||||
@@ -286,7 +295,7 @@ import * as ClueApi from '@/api/clue'
|
||||
import { createSign } from '@/api/clue/sign'
|
||||
import { getDiyFieldList } from '@/api/clue/orderField'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -331,6 +340,15 @@ const extraTotalPrice = computed(() => {
|
||||
})
|
||||
|
||||
const showSchema = computed(() => {
|
||||
let list = props.schema.map((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
return it
|
||||
})
|
||||
if (list.length % 2 != 0) {
|
||||
list.push({})
|
||||
}
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
@@ -344,7 +362,7 @@ const showSchema = computed(() => {
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
return [...props.schema, ...arr]
|
||||
return [...list, ...arr]
|
||||
})
|
||||
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
@@ -368,6 +386,7 @@ function resetForm(id) {
|
||||
state: true,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
extraPay: [],
|
||||
signProducts: []
|
||||
}
|
||||
@@ -438,8 +457,8 @@ const placeOptions = computed(() => {
|
||||
const classOptions = ref([])
|
||||
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: form.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
@@ -476,6 +495,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)
|
||||
}
|
||||
|
||||
@@ -180,6 +180,11 @@ const props = defineProps({
|
||||
|
||||
const showSchema = computed(() => {
|
||||
const arr1 = [...props.schema]
|
||||
arr1.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr1.length % 2 != 0) {
|
||||
arr1.push({})
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state == '成交'"
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
@@ -350,6 +351,7 @@ function handleGain(id) {
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
|
||||
@@ -60,14 +60,14 @@
|
||||
<el-tab-pane label="报价信息" name="price">
|
||||
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
||||
<el-table :data="formData.quotations">
|
||||
<el-table-column width="160px">
|
||||
<el-table-column>
|
||||
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
||||
<template #default="{ row }">
|
||||
<el-input v-if="row.edit" v-model="row.guidingPrice" type="number" :min="0" />
|
||||
<span v-else>{{ row.guidingPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="160px">
|
||||
<!-- <el-table-column width="160px">
|
||||
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
||||
<template #default="{ row }">
|
||||
<el-input v-if="row.edit" v-model="row.minPrice" type="number" :min="0" />
|
||||
@@ -80,7 +80,7 @@
|
||||
<el-input v-if="row.edit" v-model="row.costPrice" type="number" :min="0" />
|
||||
<span v-else>{{ row.costPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="生效日期">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
@@ -108,7 +108,171 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="提成结算" name="comission">
|
||||
<el-tab-pane label="公司利润" name="profitCompany">
|
||||
<el-form
|
||||
:model="profitCompanyForm"
|
||||
ref="profitCompanyRef"
|
||||
:rules="profitCompanyRules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<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.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitCompanyForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" value="+" />
|
||||
<el-option label="-" value="-" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitCompanyForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="profitCompanyForm.dangwei.push({ signPrice: undefined, profit: undefined })"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
class="flex items-center"
|
||||
v-for="(item, index) in profitCompanyForm.dangwei"
|
||||
:key="index"
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="员工利润" name="profitEmployee">
|
||||
<el-form
|
||||
:model="profitEmployeeForm"
|
||||
ref="profitEmployeeRef"
|
||||
:rules="profitEmployeeRules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<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.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitEmployeeForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" :value="1" />
|
||||
<el-option label="-" :value="2" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitEmployeeForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
profitEmployeeForm.dangwei.push({ signPrice: undefined, profit: undefined })
|
||||
"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
class="flex items-center"
|
||||
v-for="(item, index) in profitEmployeeForm.dangwei"
|
||||
:key="index"
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="false" label="提成结算" name="comission">
|
||||
<el-button v-if="!comissionShow" type="primary" @click="handleAddComission">
|
||||
新增提成结算规则
|
||||
</el-button>
|
||||
@@ -286,6 +450,22 @@ const formRules = reactive({
|
||||
const formRef = ref() // 表单 Ref
|
||||
const currentTab = ref('base')
|
||||
|
||||
const profitCompanyForm = ref({
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitCompanyRules = {}
|
||||
const profitCompanyRef = ref()
|
||||
|
||||
const profitEmployeeForm = ref({
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitEmployeeRules = {}
|
||||
const profitEmployeeRef = ref()
|
||||
|
||||
const opts = ref({
|
||||
percentage_param1: [],
|
||||
percentage_param2: [],
|
||||
@@ -298,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()
|
||||
@@ -311,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
|
||||
}
|
||||
@@ -339,17 +551,15 @@ function handleAddPrice() {
|
||||
formData.value.quotations.push({
|
||||
edit: true,
|
||||
guidingPrice: undefined,
|
||||
minPrice: undefined,
|
||||
costPrice: undefined,
|
||||
// minPrice: undefined,
|
||||
// costPrice: undefined,
|
||||
validTime: undefined,
|
||||
quotationTime: formatDate(new Date(), 'YYYY-MM-DD')
|
||||
})
|
||||
}
|
||||
|
||||
function handleDeletePrice(row, index) {
|
||||
if (row.edit) {
|
||||
formData.value.quotations.splice(index, 1)
|
||||
}
|
||||
message.success('删除成功')
|
||||
}
|
||||
|
||||
@@ -401,6 +611,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'))
|
||||
|
||||
@@ -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() // 消息弹窗
|
||||
|
||||
@@ -198,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' }
|
||||
]
|
||||
|
||||
@@ -219,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 {
|
||||
|
||||
Reference in New Issue
Block a user