From 8f1b89cc91c2c62e08b7cef33260981026ce1d63 Mon Sep 17 00:00:00 2001 From: qsh <> Date: Thu, 4 Jul 2024 14:41:34 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.base | 8 +- .../Class/Comp/DialogClass.vue | 190 +++++++++++++++++- 2 files changed, 188 insertions(+), 10 deletions(-) diff --git a/.env.base b/.env.base index a5f94e7..d470c46 100644 --- a/.env.base +++ b/.env.base @@ -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 diff --git a/src/views/SchoolManagement/Class/Comp/DialogClass.vue b/src/views/SchoolManagement/Class/Comp/DialogClass.vue index 4059f54..c035206 100644 --- a/src/views/SchoolManagement/Class/Comp/DialogClass.vue +++ b/src/views/SchoolManagement/Class/Comp/DialogClass.vue @@ -60,14 +60,14 @@ 新增报价 - + - + @@ -25,6 +28,7 @@ import MallOrderList from './Comp/MallOrderList.vue' import Reback from './Comp/Reback.vue' import AfterSales from './Comp/AfterSales.vue' import Delivery from './Comp/Delivery.vue' +import Settle from './Comp/Settle.vue' const appStore = useAppStore() const tabName = ref('list') diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue index 2734060..e7601b5 100644 --- a/src/views/Clue/Pool/Comp/DialogSuccess.vue +++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue @@ -79,6 +79,7 @@ :disabled="!form.signPlace" placeholder="选择班型" filterable + @change="changeClass" > + + + + + + + + (it.typeId = form.value.signClass)).guidingPrice || 0 +} + function handleRemove(type, index) { form.value[type].splice(index, 1) } diff --git a/src/views/SchoolManagement/Class/Comp/DialogClass.vue b/src/views/SchoolManagement/Class/Comp/DialogClass.vue index 0cd910c..ab63f3e 100644 --- a/src/views/SchoolManagement/Class/Comp/DialogClass.vue +++ b/src/views/SchoolManagement/Class/Comp/DialogClass.vue @@ -116,26 +116,26 @@ label-width="90px" > - + 比例模式 固定模式 -
+
公司利润 = ( 成交价 - - + + ) 乘以
-
+
添加利润档位
成交额满 ,公司利润为 - + 比例模式 固定模式 -
+
公司利润 = ( 成交价 ) 乘以
-
+
添加利润档位 @@ -249,7 +249,7 @@ > 成交额满 ,公司利润为 { dialogVisible.value = true dialogTitle.value = type == 'create' ? '新增班型' : '修改班型' formType.value = type + currentTab.value = 'base' resetForm() if (!opts.value.length) { const arr = await ClassApi.getCommissionParams() @@ -489,6 +492,37 @@ const open = async (type, id) => { try { formData.value = await ClassApi.getClassType(id) formData.value.schPlace = [formData.value.schoolId, formData.value.placeId] + if (!formData.value.companyProfitVO) { + profitCompanyForm.value = { + profitMode: 1, + dangwei: [], + profitRule: {} + } + } else if (formData.value.companyProfitVO.profitMode == 1) { + profitCompanyForm.value = { ...formData.value.companyProfitVO, dangwei: [] } + } else { + profitCompanyForm.value = { + ...formData.value.companyProfitVO, + dangwei: formData.value.companyProfitVO.profitRule + } + profitCompanyForm.value.profitRule = {} + } + + if (!formData.value.personProfitVO) { + profitEmployeeForm.value = { + profitMode: 1, + dangwei: [], + profitRule: {} + } + } else if (formData.value.personProfitVO.profitMode == 1) { + profitEmployeeForm.value = { ...formData.value.personProfitVO, dangwei: [] } + } else { + profitEmployeeForm.value = { + ...formData.value.personProfitVO, + dangwei: formData.value.personProfitVO.profitRule + } + profitEmployeeForm.value.profitRule = {} + } } finally { formLoading.value = false } @@ -579,6 +613,51 @@ async function submitForm() { delete data.schPlace delete data.percentages data.percentages = { ...comissionForm.value } + data.companyProfitVO = { ...profitCompanyForm.value } + data.personProfitVO = { ...profitEmployeeForm.value } + if (data.companyProfitVO.profitMode == 1) { + data.companyProfitVO.profitRule.minPrice = data.companyProfitVO.profitRule.minPrice || 0 + if (!data.companyProfitVO.profitRule.mark || !data.companyProfitVO.profitRule.rate) { + message.info('请将公司利润计算规则填写完整!') + return + } + } else { + data.companyProfitVO.profitRule = data.companyProfitVO?.dangwei || [] + delete data.companyProfitVO.dangwei + if (data.companyProfitVO.profitRule.length == 0) { + message.info('请添加公司利润计算规则!') + return + } else if ( + data.companyProfitVO.profitRule.some( + (it) => it.signPrice == undefined || it.profit == undefined + ) + ) { + message.info('请将公司利润计算规则填写完整!') + return + } + } + + if (data.personProfitVO.profitMode == 1) { + data.personProfitVO.profitRule.minPrice = data.personProfitVO.profitRule.minPrice || 0 + if (!data.personProfitVO.profitRule.mark || !data.personProfitVO.profitRule.rate) { + message.info('请将员工利润计算规则填写完整!') + return + } + } else { + data.personProfitVO.profitRule = data.personProfitVO?.dangwei || [] + delete data.personProfitVO.dangwei + if (data.personProfitVO.profitRule.length == 0) { + message.info('请添加员工利润计算规则!') + return + } else if ( + data.personProfitVO.profitRule.some( + (it) => it.signPrice == undefined || it.profit == undefined + ) + ) { + message.info('请将员工利润计算规则填写完整!') + return + } + } if (formType.value === 'create') { await ClassApi.createClassType(data) message.success(t('common.createSuccess')) diff --git a/src/views/SchoolManagement/Class/index.vue b/src/views/SchoolManagement/Class/index.vue index 0edfe16..921f1bb 100644 --- a/src/views/SchoolManagement/Class/index.vue +++ b/src/views/SchoolManagement/Class/index.vue @@ -82,7 +82,13 @@ /> @@ -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 { -- 2.38.1.windows.1 From 46c66e19aafd097bf9b1a3bc13716d45bbdce58f Mon Sep 17 00:00:00 2001 From: qsh <> Date: Mon, 8 Jul 2024 15:55:40 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Clue/Order/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/Clue/Order/index.vue b/src/views/Clue/Order/index.vue index 266717e..38d203d 100644 --- a/src/views/Clue/Order/index.vue +++ b/src/views/Clue/Order/index.vue @@ -15,7 +15,7 @@ - + @@ -29,6 +29,7 @@ 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') -- 2.38.1.windows.1 From 18ed17b131735e33cfee3d31ab86d21a7de8828d Mon Sep 17 00:00:00 2001 From: qsh <> Date: Tue, 9 Jul 2024 17:29:42 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/clue/afterSale.js | 6 +- src/api/clue/delivery.js | 2 +- src/api/clue/followRecord.js | 6 +- src/api/clue/index.js | 6 +- src/api/clue/payment.js | 6 +- src/api/clue/settle.js | 16 + src/api/clue/sign.js | 2 +- src/api/clue/skill.js | 2 +- src/api/clue/source.js | 2 +- src/api/mall/product/brand.ts | 2 +- src/api/mall/product/category.ts | 6 +- src/api/mall/product/index.js | 6 +- src/api/mall/product/productField.js | 6 +- src/api/mall/product/property.ts | 6 +- src/api/mall/purchase/index.js | 6 +- src/api/mall/warehouse/index.js | 6 +- src/api/school/class/index.js | 12 +- src/api/school/place/index.js | 6 +- src/api/school/sch/index.js | 6 +- src/config/axios/index.ts | 3 +- src/config/axios/service.ts | 59 ++-- src/layout/components/Setting/src/Setting.vue | 4 +- src/views/Clue/Order/Comp/MallOrderList.vue | 2 + src/views/Clue/Order/Comp/MallSettle.vue | 323 ++++++++++++++++++ src/views/Clue/Order/Comp/OrderList.vue | 6 +- src/views/Clue/Order/Comp/SchoolSettle.vue | 121 ++++++- src/views/Clue/Order/Comp/Settle.vue | 2 + src/views/Clue/Pool/Comp/DialogClue.vue | 4 + src/views/Clue/Pool/Comp/DialogSuccess.vue | 6 +- src/views/Clue/Pool/index.vue | 1 + .../Class/Comp/DialogClass.vue | 4 +- 31 files changed, 580 insertions(+), 65 deletions(-) create mode 100644 src/api/clue/settle.js create mode 100644 src/views/Clue/Order/Comp/MallSettle.vue 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('删除成功') } -- 2.38.1.windows.1 From d31f4b4f8bef7d8dc76d922863172db6a12ad82d Mon Sep 17 00:00:00 2001 From: qsh <> Date: Wed, 10 Jul 2024 17:58:08 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/clue/settle.js | 22 ++-- src/components/Form/src/Form.vue | 5 +- src/utils/index.ts | 2 +- .../Basic/Role/RoleDataPermissionForm.vue | 9 +- src/views/Clue/Order/Comp/MallSettle.vue | 100 ++++++++++-------- src/views/Clue/Order/Comp/SchoolSettle.vue | 72 ++++++++----- src/views/Clue/Pool/Comp/DialogClue.vue | 19 ++-- 7 files changed, 140 insertions(+), 89 deletions(-) diff --git a/src/api/clue/settle.js b/src/api/clue/settle.js index c6614e5..d9e5609 100644 --- a/src/api/clue/settle.js +++ b/src/api/clue/settle.js @@ -1,13 +1,23 @@ import request from '@/config/axios' -// 查询列表 -export const getSettlePage = async (params) => { - return await request.get({ url: '/admin-api/crm/sign-settlement/page', params }) +// 查询招生结算列表 +export const getSchoolSettlePage = async (params) => { + return await request.get({ url: '/admin-api/crm/sign-settlement/sch/page', params }) } -// 查询详情 -export const getSettle = async (id) => { - return await request.get({ url: '/admin-api/crm/sign-settlement/get?id=' + id }) +// 查询招生结算详情 +export const getSchoolSettleDetail = async (id) => { + return await request.get({ url: '/admin-api/crm/sign-settlement/sch/get?id=' + id }) +} + +// 查询进销存结算列表 +export const getMallSettlePage = async (params) => { + return await request.get({ url: '/admin-api/crm/sign-settlement/erp/page', params }) +} + +// 查询进销存结算详情 +export const getMallSettleDetail = async (id) => { + return await request.get({ url: '/admin-api/crm/sign-settlement/erp/get?id=' + id }) } // 批量结算 diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index d3a00bf..db784a1 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -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) } diff --git a/src/utils/index.ts b/src/utils/index.ts index 4877020..d1d5f79 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -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] } } diff --git a/src/views/Basic/Role/RoleDataPermissionForm.vue b/src/views/Basic/Role/RoleDataPermissionForm.vue index 9c04ed6..9d68235 100644 --- a/src/views/Basic/Role/RoleDataPermissionForm.vue +++ b/src/views/Basic/Role/RoleDataPermissionForm.vue @@ -107,7 +107,14 @@ const dataScopeOptions = [ ] async function getRoleInfo(id) { - formData.value = await RoleApi.getRole(id) + try { + formData.value = await RoleApi.getRole(id) + nextTick(() => { + treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds) + }) + } catch (error) { + console.log(error) + } } /** 提交表单 */ diff --git a/src/views/Clue/Order/Comp/MallSettle.vue b/src/views/Clue/Order/Comp/MallSettle.vue index ac85543..14f10b2 100644 --- a/src/views/Clue/Order/Comp/MallSettle.vue +++ b/src/views/Clue/Order/Comp/MallSettle.vue @@ -11,9 +11,9 @@ - - - + + + @@ -39,11 +39,11 @@ - + 已结算 - 未结算 + 待结算 @@ -101,38 +101,42 @@ :summary-method="getSummaries" @selection-change="handleSelectionChange" > - + - - - - - - - + + + + + + - - - + + + -