salary
qsh 5 months ago
parent 46c66e19aa
commit 18ed17b131
  1. 6
      src/api/clue/afterSale.js
  2. 2
      src/api/clue/delivery.js
  3. 6
      src/api/clue/followRecord.js
  4. 6
      src/api/clue/index.js
  5. 6
      src/api/clue/payment.js
  6. 16
      src/api/clue/settle.js
  7. 2
      src/api/clue/sign.js
  8. 2
      src/api/clue/skill.js
  9. 2
      src/api/clue/source.js
  10. 2
      src/api/mall/product/brand.ts
  11. 6
      src/api/mall/product/category.ts
  12. 6
      src/api/mall/product/index.js
  13. 6
      src/api/mall/product/productField.js
  14. 6
      src/api/mall/product/property.ts
  15. 6
      src/api/mall/purchase/index.js
  16. 6
      src/api/mall/warehouse/index.js
  17. 12
      src/api/school/class/index.js
  18. 6
      src/api/school/place/index.js
  19. 6
      src/api/school/sch/index.js
  20. 3
      src/config/axios/index.ts
  21. 55
      src/config/axios/service.ts
  22. 2
      src/layout/components/Setting/src/Setting.vue
  23. 2
      src/views/Clue/Order/Comp/MallOrderList.vue
  24. 323
      src/views/Clue/Order/Comp/MallSettle.vue
  25. 6
      src/views/Clue/Order/Comp/OrderList.vue
  26. 121
      src/views/Clue/Order/Comp/SchoolSettle.vue
  27. 2
      src/views/Clue/Order/Comp/Settle.vue
  28. 4
      src/views/Clue/Pool/Comp/DialogClue.vue
  29. 6
      src/views/Clue/Pool/Comp/DialogSuccess.vue
  30. 1
      src/views/Clue/Pool/index.vue
  31. 2
      src/views/SchoolManagement/Class/Comp/DialogClass.vue

@ -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
})
}
// 审核

@ -0,0 +1,16 @@
import request from '@/config/axios'
// 查询列表
export const getSettlePage = async (params) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/page', params })
}
// 查询详情
export const getSettle = async (id) => {
return await request.get({ url: '/admin-api/crm/sign-settlement/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
})
}
// 修改

@ -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]) + '&'
config.params = {}
const paramsStr = qs.stringify(params, { allowDots: true })
if (paramsStr) {
config.url = config.url + '?' + paramsStr
}
} else {
url += `${propName}=${encodeURIComponent(value)}&`
}
// 是否提交表单型的接口,如果是,不要频繁调接口
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)
}
}
// 给 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
}
return config
},

@ -16,7 +16,9 @@ import { useWatermark } from '@/hooks/web/useWatermark'
const { setWatermark } = useWatermark()
nextTick(() => {
setWatermark('安徽莳松科技有限公司')
})
const { t } = useI18n()
const appStore = useAppStore()

@ -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

@ -0,0 +1,323 @@
<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.settleType" placeholder="结算类型" clearable filterable>
<el-option label="报名费" :value="1" />
<el-option label="其他支出" :value="2" />
</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.productId"
placeholder="选择成交产品"
filterable
clearable
@change="searchForm.specsId = 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.specsId"
placeholder="选择规格"
filterable
clearable
:disabled="!searchForm.productId"
>
<el-option
v-for="item in specsOptions(searchForm.productId)"
: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.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
show-summary
:summary-method="getSummaries"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="60" />
<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 label="费用备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.feeRemark">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="scope.row.feeRemark"></div>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop="settleTime"
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 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="结算备注" 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 { getSimpleProductList } from '@/api/mall/product'
import * as SettleApi from '@/api/clue/settle'
import { getDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
const message = useMessage() //
onMounted(() => {
getOptions()
handleSearch()
})
const searchForm = ref({
name: undefined,
phone: undefined,
signUser: undefined,
dealDate: [],
productId: undefined,
specsId: undefined,
signClass: undefined,
signId: undefined,
settleStatus: 2,
settleType: undefined,
supplier: undefined,
pageSize: 20,
pageNo: 1
})
function handleReset() {
searchForm.value = {
name: undefined,
phone: undefined,
signUser: undefined,
dealDate: [],
signSchool: undefined,
signPlace: undefined,
signClass: undefined,
signId: undefined,
settleType: undefined,
supplier: 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 SettleApi.getSettlePage(searchForm.value)
tableList.value = data.list
total.value = data.total
} 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 == 'settleNum') {
sums[index] = 123
} else if (column.property == 'settleAmount') {
sums[index] = 54321
} else {
sums[index] = ''
}
})
return sums
}
const batchIds = ref([])
function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.id)
}
const showDailog = ref(false)
const form = ref({})
const formRef = ref()
const formLoading = ref(false)
const rules = {
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
}
function batchSettle() {
if (batchIds.value.length) {
showDailog.value = true
form.value = {
signIds: batchIds.value,
reamrk: undefined
}
} else {
message.info('请选择表格数据!')
}
}
async function handleSaveSettle() {
if (!formRef.value) return
const valid = await formRef.value.getElFormRef().validate()
if (!valid) return
try {
formLoading.value = true
await SettleApi.batchSaveSettle(form.value)
message.success(data)
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>

@ -173,7 +173,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'
@ -325,8 +325,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() {

@ -10,6 +10,12 @@
<el-form-item>
<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>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
<el-option
@ -86,7 +92,6 @@
<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>
@ -98,8 +103,11 @@
v-loading="loading"
:data="tableList"
border
show-summary
:summary-method="getSummaries"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="60" />
<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" />
@ -108,16 +116,35 @@
<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="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 label="费用备注" width="90px">
<template #default="scope">
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.feeRemark">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="scope.row.feeRemark"></div>
</el-popover>
</template>
</el-table-column>
<el-table-column
prop="settleTime"
label="结算时间"
width="120px"
:formatter="dateFormatter"
/>
<el-table-column prop="settleUser" label="结算人" min-width="90px" />
<el-table-column prop="settleStatus" label="结算状态" width="90px" />
<el-table-column label="结算备注">
<el-table-column prop="settleType" label="结算类型" width="90px" fixed="right" />
<el-table-column prop="settleStatus" 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.settleRemark"></div>
<div v-dompurify-html="scope.row.remark"></div>
</el-popover>
</template>
</el-table-column>
@ -128,13 +155,34 @@
: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="结算备注" 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 { getClassTypePage } from '@/api/school/class'
import { getClassTypeList } from '@/api/school/class'
import * as SettleApi from '@/api/clue/settle'
import { dateFormatter } from '@/utils/formatTime'
const message = useMessage() //
onMounted(() => {
getOptions()
@ -150,6 +198,7 @@ const searchForm = ref({
signPlace: undefined,
signClass: undefined,
signId: undefined,
settleType: undefined,
settleStatus: 2,
pageSize: 20,
pageNo: 1
@ -165,6 +214,7 @@ function handleReset() {
signPlace: undefined,
signClass: undefined,
signId: undefined,
settleType: undefined,
settleStatus: 2,
pageSize: 20,
pageNo: 1
@ -182,7 +232,7 @@ const total = ref(0)
async function getList() {
loading.value = true
try {
const data = await DeliveryApi.getDeliveryPage(searchForm.value)
const data = await SettleApi.getSettlePage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
@ -190,12 +240,63 @@ async function getList() {
}
}
function getSummaries(param) {
const { columns } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
} else if (column.property == 'settleNum') {
sums[index] = 123
} else if (column.property == 'settleAmount') {
sums[index] = 54321
} else {
sums[index] = ''
}
})
return sums
}
const batchIds = ref([])
function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.id)
}
function batchSettle() {}
const showDailog = ref(false)
const form = ref({})
const formRef = ref()
const formLoading = ref(false)
const rules = {
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
}
function batchSettle() {
if (batchIds.value.length) {
showDailog.value = true
form.value = {
signIds: batchIds.value,
reamrk: undefined
}
} else {
message.info('请选择表格数据!')
}
}
async function handleSaveSettle() {
if (!formRef.value) return
const valid = await formRef.value.getElFormRef().validate()
if (!valid) return
try {
formLoading.value = true
await SettleApi.batchSaveSettle(form.value)
message.success(data)
showDailog.value = false
getList()
} finally {
formLoading.value = false
}
}
const schoolOptions = ref([])
const allPlaceOptions = ref([])
@ -228,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
}
</script>

@ -1,12 +1,14 @@
<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>

@ -232,6 +232,10 @@ const open = async (type, id) => {
try {
const data = await ClueApi.getClue(id)
info.value = { ...data, ...data.diyParams }
defaultLatLng.value = {
lat: data.lat,
lng: data.lng
}
nextTick(() => {
followList.value = data.followUser
address.value = data.address || ''

@ -295,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'
@ -448,8 +448,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() {

@ -350,6 +350,7 @@ function handleGain(id) {
}
const userOptions = ref([])
onMounted(() => {
getUserOption().then((data) => {
userOptions.value = data

@ -559,9 +559,7 @@ function handleAddPrice() {
}
function handleDeletePrice(row, index) {
if (row.edit) {
formData.value.quotations.splice(index, 1)
}
message.success('删除成功')
}

Loading…
Cancel
Save