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/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..d9e5609 --- /dev/null +++ b/src/api/clue/settle.js @@ -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 }) +} 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/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/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/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/AfterSales.vue b/src/views/Clue/Order/Comp/AfterSales.vue index 3e5736a..2fc3371 100644 --- a/src/views/Clue/Order/Comp/AfterSales.vue +++ b/src/views/Clue/Order/Comp/AfterSales.vue @@ -32,8 +32,8 @@ format="YYYY-MM-DD" value-format="YYYY-MM-DD" range-separator="-" - start-placeholder="登记日期" - end-placeholder="登记日期" + start-placeholder="成交日期" + end-placeholder="成交日期" /> @@ -79,9 +79,19 @@ - + - + @@ -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() diff --git a/src/views/Clue/Order/Comp/Delivery.vue b/src/views/Clue/Order/Comp/Delivery.vue index 6b50606..25c24da 100644 --- a/src/views/Clue/Order/Comp/Delivery.vue +++ b/src/views/Clue/Order/Comp/Delivery.vue @@ -24,8 +24,8 @@ format="YYYY-MM-DD" value-format="YYYY-MM-DD" range-separator="-" - start-placeholder="登记日期" - end-placeholder="登记日期" + start-placeholder="成交日期" + end-placeholder="成交日期" /> @@ -71,7 +71,7 @@ - + diff --git a/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue b/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue index d2b7b0e..1dfe612 100644 --- a/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue +++ b/src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue @@ -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 }, { diff --git a/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue b/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue index 66f46ba..c92d506 100644 --- a/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue +++ b/src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue @@ -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 }, { diff --git a/src/views/Clue/Order/Comp/DialogFeebackAudit.vue b/src/views/Clue/Order/Comp/DialogFeebackAudit.vue index e2ec956..5e42600 100644 --- a/src/views/Clue/Order/Comp/DialogFeebackAudit.vue +++ b/src/views/Clue/Order/Comp/DialogFeebackAudit.vue @@ -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 }, { diff --git a/src/views/Clue/Order/Comp/DialogFeebackDetail.vue b/src/views/Clue/Order/Comp/DialogFeebackDetail.vue index 3f16d12..bd7db44 100644 --- a/src/views/Clue/Order/Comp/DialogFeebackDetail.vue +++ b/src/views/Clue/Order/Comp/DialogFeebackDetail.vue @@ -40,8 +40,8 @@ const applySchema = [ }, { field: 'dealDate', - label: '登记时间', - dateFormat: 'YYYY-MM-DD HH:mm:ss', + label: '成交日期', + dateFormat: 'YYYY-MM-DD', span: 1 }, { diff --git a/src/views/Clue/Order/Comp/DialogOrder.vue b/src/views/Clue/Order/Comp/DialogOrder.vue index 2244a25..baacd8c 100644 --- a/src/views/Clue/Order/Comp/DialogOrder.vue +++ b/src/views/Clue/Order/Comp/DialogOrder.vue @@ -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({}) } diff --git a/src/views/Clue/Order/Comp/MallOrderList.vue b/src/views/Clue/Order/Comp/MallOrderList.vue index 8ffef86..c2fc013 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" > + + {{ formatDate(row[item.field]) }} + @@ -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(() => { diff --git a/src/views/Clue/Order/Comp/MallSettle.vue b/src/views/Clue/Order/Comp/MallSettle.vue new file mode 100644 index 0000000..3ec56c1 --- /dev/null +++ b/src/views/Clue/Order/Comp/MallSettle.vue @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已结算 + 待结算 + + + + + 查询 + 重置 + 批量结算 + + + + + + + + + + + + + + + + + + + + + 点击查看 + + + + + + + + + + + + + + 点击查看 + + + + + + + + + + + {{ settleAmount }} + + + + + + + + 取 消 + + 确 定 + + + + + + + + + + diff --git a/src/views/Clue/Order/Comp/OrderList.vue b/src/views/Clue/Order/Comp/OrderList.vue index f9c89c0..142985f 100644 --- a/src/views/Clue/Order/Comp/OrderList.vue +++ b/src/views/Clue/Order/Comp/OrderList.vue @@ -100,6 +100,9 @@ + + {{ formatDate(row[item.field]) }} + {{ row[item.field] }} @@ -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() { diff --git a/src/views/Clue/Order/Comp/Reback.vue b/src/views/Clue/Order/Comp/Reback.vue index 74c6903..5c7b605 100644 --- a/src/views/Clue/Order/Comp/Reback.vue +++ b/src/views/Clue/Order/Comp/Reback.vue @@ -32,8 +32,8 @@ format="YYYY-MM-DD" value-format="YYYY-MM-DD" range-separator="-" - start-placeholder="登记日期" - end-placeholder="登记日期" + start-placeholder="成交日期" + end-placeholder="成交日期" /> @@ -77,9 +77,19 @@ - + - + @@ -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() // 消息弹窗 diff --git a/src/views/Clue/Order/Comp/SchoolSettle.vue b/src/views/Clue/Order/Comp/SchoolSettle.vue new file mode 100644 index 0000000..95b2b0a --- /dev/null +++ b/src/views/Clue/Order/Comp/SchoolSettle.vue @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已结算 + 待结算 + + + + 查询 + 重置 + 批量结算 + + + + + + + + + + + + + + + + + + + + + 点击查看 + + + + + + + + + + + + + + 点击查看 + + + + + + + + + + + + {{ settleAmount }} + + + + + + + + 取 消 + + 确 定 + + + + + + + + + + diff --git a/src/views/Clue/Order/Comp/Settle.vue b/src/views/Clue/Order/Comp/Settle.vue new file mode 100644 index 0000000..7558037 --- /dev/null +++ b/src/views/Clue/Order/Comp/Settle.vue @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/src/views/Clue/Order/index.vue b/src/views/Clue/Order/index.vue index 662ce8c..38d203d 100644 --- a/src/views/Clue/Order/index.vue +++ b/src/views/Clue/Order/index.vue @@ -15,6 +15,9 @@ + + + @@ -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') diff --git a/src/views/Clue/Order/order.data.js b/src/views/Clue/Order/order.data.js deleted file mode 100644 index c1dfd1d..0000000 --- a/src/views/Clue/Order/order.data.js +++ /dev/null @@ -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) diff --git a/src/views/Clue/Pool/Comp/DialogClue.vue b/src/views/Clue/Pool/Comp/DialogClue.vue index 5e1c407..4e3f142 100644 --- a/src/views/Clue/Pool/Comp/DialogClue.vue +++ b/src/views/Clue/Pool/Comp/DialogClue.vue @@ -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([]) diff --git a/src/views/Clue/Pool/Comp/DialogSuccess.vue b/src/views/Clue/Pool/Comp/DialogSuccess.vue index 2734060..60cbb21 100644 --- a/src/views/Clue/Pool/Comp/DialogSuccess.vue +++ b/src/views/Clue/Pool/Comp/DialogSuccess.vue @@ -10,31 +10,6 @@ /> - - - - - - - - - 全款 - 非全款 - - - - - - - - @@ -79,6 +54,7 @@ :disabled="!form.signPlace" placeholder="选择班型" filterable + @change="changeClass" > + + + + + + + + + 全款 + 非全款 + + + + + + + + + + + + 是 + 否 + + + { }) 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) } diff --git a/src/views/Clue/Pool/Comp/DrawerClue.vue b/src/views/Clue/Pool/Comp/DrawerClue.vue index 3e153aa..620b5a6 100644 --- a/src/views/Clue/Pool/Comp/DrawerClue.vue +++ b/src/views/Clue/Pool/Comp/DrawerClue.vue @@ -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({}) } diff --git a/src/views/Clue/Pool/index.vue b/src/views/Clue/Pool/index.vue index d3c75a8..1602cce 100644 --- a/src/views/Clue/Pool/index.vue +++ b/src/views/Clue/Pool/index.vue @@ -133,6 +133,7 @@ @@ -350,6 +351,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 4cebace..e6659e9 100644 --- a/src/views/SchoolManagement/Class/Comp/DialogClass.vue +++ b/src/views/SchoolManagement/Class/Comp/DialogClass.vue @@ -60,14 +60,14 @@ 新增报价 - + 指导价 {{ row.guidingPrice }} - + - + + + + + 比例模式 + 固定模式 + + + + + 公司利润 = ( 成交价 + + + + + + ) 乘以 + + + + 添加利润档位 + + 成交额满 + + ,公司利润为 + + + + + + + + + + + 比例模式 + 固定模式 + + + + + 公司利润 = ( 成交价 + + + + + + ) 乘以 + + + + 添加利润档位 + + 成交额满 + + ,公司利润为 + + + + + + + 新增提成结算规则 @@ -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) - } + 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')) 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 {