diff --git a/src/api/clue/afterSale.js b/src/api/clue/afterSale.js index 685289a..1321ec8 100644 --- a/src/api/clue/afterSale.js +++ b/src/api/clue/afterSale.js @@ -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 + }) } // 审核 diff --git a/src/api/clue/delivery.js b/src/api/clue/delivery.js index a7c1b51..ca8d19b 100644 --- a/src/api/clue/delivery.js +++ b/src/api/clue/delivery.js @@ -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 }) } // 查询详情 diff --git a/src/api/clue/followRecord.js b/src/api/clue/followRecord.js index 81fb223..6fa0c34 100644 --- a/src/api/clue/followRecord.js +++ b/src/api/clue/followRecord.js @@ -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 + }) } // 删除 diff --git a/src/api/clue/index.js b/src/api/clue/index.js index 85e4464..774909e 100644 --- a/src/api/clue/index.js +++ b/src/api/clue/index.js @@ -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 + }) } // 修改 diff --git a/src/api/clue/payment.js b/src/api/clue/payment.js index 4a63fbf..f67ca24 100644 --- a/src/api/clue/payment.js +++ b/src/api/clue/payment.js @@ -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 + }) } // 审核 diff --git a/src/api/clue/settle.js b/src/api/clue/settle.js new file mode 100644 index 0000000..c6614e5 --- /dev/null +++ b/src/api/clue/settle.js @@ -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 }) +} diff --git a/src/api/clue/sign.js b/src/api/clue/sign.js index e6f4d4e..2dc80f2 100644 --- a/src/api/clue/sign.js +++ b/src/api/clue/sign.js @@ -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 }) } // 取消登记 diff --git a/src/api/clue/skill.js b/src/api/clue/skill.js index c970757..3ee5c68 100644 --- a/src/api/clue/skill.js +++ b/src/api/clue/skill.js @@ -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 }) } // 更新 diff --git a/src/api/clue/source.js b/src/api/clue/source.js index b461add..afeb22a 100644 --- a/src/api/clue/source.js +++ b/src/api/clue/source.js @@ -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 }) } // 修改 diff --git a/src/api/mall/product/brand.ts b/src/api/mall/product/brand.ts index 1173d98..9191677 100644 --- a/src/api/mall/product/brand.ts +++ b/src/api/mall/product/brand.ts @@ -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 }) } // 更新商品品牌 diff --git a/src/api/mall/product/category.ts b/src/api/mall/product/category.ts index 9b40189..efc85f5 100644 --- a/src/api/mall/product/category.ts +++ b/src/api/mall/product/category.ts @@ -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 + }) } // 更新商品分类 diff --git a/src/api/mall/product/index.js b/src/api/mall/product/index.js index 3d1d185..80c9a98 100644 --- a/src/api/mall/product/index.js +++ b/src/api/mall/product/index.js @@ -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 + }) } // 修改 diff --git a/src/api/mall/product/productField.js b/src/api/mall/product/productField.js index f8cfac8..f740e90 100644 --- a/src/api/mall/product/productField.js +++ b/src/api/mall/product/productField.js @@ -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 + }) } // 更新 diff --git a/src/api/mall/product/property.ts b/src/api/mall/product/property.ts index b9fb9b7..b2c2ce5 100644 --- a/src/api/mall/product/property.ts +++ b/src/api/mall/product/property.ts @@ -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 + }) } // 更新属性项 diff --git a/src/api/mall/purchase/index.js b/src/api/mall/purchase/index.js index 9908640..ea5e0a9 100644 --- a/src/api/mall/purchase/index.js +++ b/src/api/mall/purchase/index.js @@ -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 + }) } // 修改 diff --git a/src/api/mall/warehouse/index.js b/src/api/mall/warehouse/index.js index 6858d62..40a863a 100644 --- a/src/api/mall/warehouse/index.js +++ b/src/api/mall/warehouse/index.js @@ -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 + }) } // 修改 diff --git a/src/api/school/class/index.js b/src/api/school/class/index.js index 6216090..0331cf0 100644 --- a/src/api/school/class/index.js +++ b/src/api/school/class/index.js @@ -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 }) } // 修改状态 diff --git a/src/api/school/place/index.js b/src/api/school/place/index.js index 0c743e7..b469cdc 100644 --- a/src/api/school/place/index.js +++ b/src/api/school/place/index.js @@ -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 + }) } // 修改 diff --git a/src/api/school/sch/index.js b/src/api/school/sch/index.js index 05e21b7..22f4b5d 100644 --- a/src/api/school/sch/index.js +++ b/src/api/school/sch/index.js @@ -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 + }) } // 修改 diff --git a/src/config/axios/index.ts b/src/config/axios/index.ts index e6c6af8..f857d5a 100644 --- a/src/config/axios/index.ts +++ b/src/config/axios/index.ts @@ -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, diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 8adfc2f..a65905b 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -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)}&` - } + config.params = {} + 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) } } - // 给 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 }, diff --git a/src/layout/components/Setting/src/Setting.vue b/src/layout/components/Setting/src/Setting.vue index 3420e5a..908ed99 100644 --- a/src/layout/components/Setting/src/Setting.vue +++ b/src/layout/components/Setting/src/Setting.vue @@ -16,7 +16,9 @@ import { useWatermark } from '@/hooks/web/useWatermark' const { setWatermark } = useWatermark() -setWatermark('安徽莳松科技有限公司') +nextTick(() => { + setWatermark('安徽莳松科技有限公司') +}) const { t } = useI18n() const appStore = useAppStore() diff --git a/src/views/Clue/Order/Comp/MallOrderList.vue b/src/views/Clue/Order/Comp/MallOrderList.vue index 8ffef86..d6bf290 100644 --- a/src/views/Clue/Order/Comp/MallOrderList.vue +++ b/src/views/Clue/Order/Comp/MallOrderList.vue @@ -14,6 +14,7 @@ v-model="searchForm.signProduct" placeholder="选择成交产品" filterable + clearable @change="searchForm.specsId = undefined" > +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已结算 + 未结算 + + + + + 查询 + 重置 + 批量结算 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + diff --git a/src/views/Clue/Order/Comp/OrderList.vue b/src/views/Clue/Order/Comp/OrderList.vue index f9c89c0..0bebb56 100644 --- a/src/views/Clue/Order/Comp/OrderList.vue +++ b/src/views/Clue/Order/Comp/OrderList.vue @@ -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() { diff --git a/src/views/Clue/Order/Comp/SchoolSettle.vue b/src/views/Clue/Order/Comp/SchoolSettle.vue index 92e329f..7b091a3 100644 --- a/src/views/Clue/Order/Comp/SchoolSettle.vue +++ b/src/views/Clue/Order/Comp/SchoolSettle.vue @@ -10,6 +10,12 @@ + + + + + + 未结算 - 查询 重置 @@ -98,8 +103,11 @@ v-loading="loading" :data="tableList" border + show-summary + :summary-method="getSummaries" @selection-change="handleSelectionChange" > + @@ -108,16 +116,35 @@ - + + + + + + + - - + + + @@ -128,13 +155,34 @@ :total="total" @pagination="getList" /> + + + + + + + + + diff --git a/src/views/Clue/Order/Comp/Settle.vue b/src/views/Clue/Order/Comp/Settle.vue index 11a1432..7558037 100644 --- a/src/views/Clue/Order/Comp/Settle.vue +++ b/src/views/Clue/Order/Comp/Settle.vue @@ -1,12 +1,14 @@ diff --git a/src/views/Clue/Pool/Comp/DialogClue.vue b/src/views/Clue/Pool/Comp/DialogClue.vue index 5e1c407..b058d6c 100644 --- a/src/views/Clue/Pool/Comp/DialogClue.vue +++ b/src/views/Clue/Pool/Comp/DialogClue.vue @@ -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 || '' diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue index e7601b5..e20e320 100644 --- a/src/views/Clue/Pool/Comp/DialogSuccess.vue +++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue @@ -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() { diff --git a/src/views/Clue/Pool/index.vue b/src/views/Clue/Pool/index.vue index d3c75a8..c0d1602 100644 --- a/src/views/Clue/Pool/index.vue +++ b/src/views/Clue/Pool/index.vue @@ -350,6 +350,7 @@ function handleGain(id) { } const userOptions = ref([]) + onMounted(() => { getUserOption().then((data) => { userOptions.value = data diff --git a/src/views/SchoolManagement/Class/Comp/DialogClass.vue b/src/views/SchoolManagement/Class/Comp/DialogClass.vue index ab63f3e..e6659e9 100644 --- a/src/views/SchoolManagement/Class/Comp/DialogClass.vue +++ b/src/views/SchoolManagement/Class/Comp/DialogClass.vue @@ -559,9 +559,7 @@ function handleAddPrice() { } function handleDeletePrice(row, index) { - if (row.edit) { - formData.value.quotations.splice(index, 1) - } + formData.value.quotations.splice(index, 1) message.success('删除成功') }