From 3e7639ad7426ca52e17715b1fce7bf4465920d68 Mon Sep 17 00:00:00 2001
From: "1378012178@qq.com" <1378012178@qq.com>
Date: Wed, 16 Jul 2025 08:34:10 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8C=87=E4=BB=A4=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=AE=8C=E5=96=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Form/src/jeecg/components/JCheckbox.vue | 3 +-
.../src/jeecg/components/JDictSelectTag.vue | 6 +-
.../instructiontag/InstructionTag.vue | 31 ++++-
.../ConfigServiceCategoryList.vue | 31 ++++-
.../ConfigServiceDirective.data.ts | 6 +
.../ConfigServiceDirectiveList.vue | 2 +-
.../components/ConfigServiceDirectiveForm.vue | 107 ++++++++++++------
.../serviceType/ConfigServiceTypeList.vue | 32 +++++-
8 files changed, 164 insertions(+), 54 deletions(-)
diff --git a/src/components/Form/src/jeecg/components/JCheckbox.vue b/src/components/Form/src/jeecg/components/JCheckbox.vue
index 6b25089..408052b 100644
--- a/src/components/Form/src/jeecg/components/JCheckbox.vue
+++ b/src/components/Form/src/jeecg/components/JCheckbox.vue
@@ -24,7 +24,7 @@ export default defineComponent({
default: () => [],
},
},
- emits: ['change', 'update:value'],
+ emits: ['change', 'update:value', 'upDictCode'],
setup(props, { emit }) {
const attrs = useAttrs();
//checkbox选项
@@ -86,6 +86,7 @@ export default defineComponent({
if (res) {
checkOptions.value = res.map((item) => ({ value: item.value, label: item.text, disabled: item.status == 1 && !checkboxArray.value.includes(item.value), color: item.color }));
//console.info('res', dictOptions.value);
+ emit('upDictCode', checkOptions.value)
} else {
console.error('getDictItems error: : ', res);
checkOptions.value = [];
diff --git a/src/components/Form/src/jeecg/components/JDictSelectTag.vue b/src/components/Form/src/jeecg/components/JDictSelectTag.vue
index 88f12aa..e470cd3 100644
--- a/src/components/Form/src/jeecg/components/JDictSelectTag.vue
+++ b/src/components/Form/src/jeecg/components/JDictSelectTag.vue
@@ -34,7 +34,8 @@
- {{ item.label }}{{ ignoreDisabled && item.disabled ? '(已停用)' : '' }}
+ {{ item.label }}{{ ignoreDisabled && item.disabled ? '(已停用)' : ''
+ }}
@@ -77,7 +78,7 @@ export default defineComponent({
style: propTypes.any,
ignoreDisabled: propTypes.bool.def(false),
},
- emits: ['options-change', 'change', 'update:value'],
+ emits: ['options-change', 'change', 'update:value', 'upDictCode'],
setup(props, { emit, refs }) {
const dictOptions = ref([]);
const attrs = useAttrs();
@@ -140,6 +141,7 @@ export default defineComponent({
}
return prev;
}, []);
+ emit('upDictCode', dictOptions.value)
}
function handleChange(e) {
diff --git a/src/views/services/instructiontag/InstructionTag.vue b/src/views/services/instructiontag/InstructionTag.vue
index bbe2a0f..8fd5cfb 100644
--- a/src/views/services/instructiontag/InstructionTag.vue
+++ b/src/views/services/instructiontag/InstructionTag.vue
@@ -74,13 +74,15 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './InstructionTag.data';
-import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './InstructionTag.api';
+import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './InstructionTag.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import InstructionTagModal from './components/InstructionTagModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive({});
const toggleSearchStatus = ref(false);
@@ -186,19 +188,38 @@ function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
+//启用停用
+function handleIzEnabled(record, izEnabled_) {
+ record.izEnabled = izEnabled_
+ saveOrUpdate(record, true).then((res) => {
+ if (res.success) {
+ createMessage.success(res.message);
+ reload();
+ } else {
+ createMessage.warning(res.message);
+ }
+ })
+}
+
/**
* 操作栏
*/
function getTableAction(record) {
return [
- {
- label: '编辑',
- onClick: handleEdit.bind(null, record)
- },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
+ {
+ label: '启用',
+ onClick: handleIzEnabled.bind(null, record, '0'),
+ ifShow: record.izEnabled == 1
+ },
+ {
+ label: '停用',
+ onClick: handleIzEnabled.bind(null, record, '1'),
+ ifShow: record.izEnabled == 0
+ },
];
}
diff --git a/src/views/services/serviceCategory/ConfigServiceCategoryList.vue b/src/views/services/serviceCategory/ConfigServiceCategoryList.vue
index fe559ae..e0c4140 100644
--- a/src/views/services/serviceCategory/ConfigServiceCategoryList.vue
+++ b/src/views/services/serviceCategory/ConfigServiceCategoryList.vue
@@ -82,13 +82,15 @@ import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceCategory.data';
-import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceCategory.api';
+import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './ConfigServiceCategory.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ConfigServiceCategoryModal from './components/ConfigServiceCategoryModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive({});
const toggleSearchStatus = ref(false);
@@ -194,19 +196,38 @@ function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
+//启用停用
+function handleIzEnabled(record, izEnabled_) {
+ record.izEnabled = izEnabled_
+ saveOrUpdate(record, true).then((res) => {
+ if (res.success) {
+ createMessage.success(res.message);
+ reload();
+ } else {
+ createMessage.warning(res.message);
+ }
+ })
+}
+
/**
* 操作栏
*/
function getTableAction(record) {
return [
- {
- label: '编辑',
- onClick: handleEdit.bind(null, record)
- },
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
+ {
+ label: '启用',
+ onClick: handleIzEnabled.bind(null, record, '0'),
+ ifShow: record.izEnabled == 1
+ },
+ {
+ label: '停用',
+ onClick: handleIzEnabled.bind(null, record, '1'),
+ ifShow: record.izEnabled == 0
+ },
];
}
diff --git a/src/views/services/serviceDirective/ConfigServiceDirective.data.ts b/src/views/services/serviceDirective/ConfigServiceDirective.data.ts
index 61ae651..b6e13a2 100644
--- a/src/views/services/serviceDirective/ConfigServiceDirective.data.ts
+++ b/src/views/services/serviceDirective/ConfigServiceDirective.data.ts
@@ -100,6 +100,12 @@ export const columns: BasicColumn[] = [
dataIndex: 'serviceDuration',
width: 135,
},
+ {
+ title: '指令状态',
+ align: 'center',
+ dataIndex: 'status_dictText',
+ width: 100,
+ },
{
title: '是否启用',
align: 'center',
diff --git a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
index 2685325..f7d8d12 100644
--- a/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
+++ b/src/views/services/serviceDirective/ConfigServiceDirectiveList.vue
@@ -56,7 +56,7 @@
是否启用
-
diff --git a/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue
index 2f06b36..2898f5d 100644
--- a/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue
+++ b/src/views/services/serviceDirective/components/ConfigServiceDirectiveForm.vue
@@ -10,28 +10,31 @@
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
+ placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode"
+ :disabled="!!formData.id && formData.status == 0" />
+ :disabled="!formData.instructionTagId || (!!formData.id && formData.status == 0)"
+ :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear @upDictCode="upCategoryDictCode" />
+ :disabled="!formData.categoryId || (!!formData.id && formData.status == 0)" placeholder="请选择服务类型"
+ allowClear @upDictCode="upTypeDictCode" />
-
+
@@ -66,7 +69,8 @@
+ placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode"
+ :disabled="!!formData.id && formData.status == 0" />
@@ -82,30 +86,31 @@
+ :dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`"
+ @upDictCode="upBodyTagsDictCode" />
+ :dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`"
+ @upDictCode="upEmotionTagsDictCode" />
- 未授权
-
-
+
无文件
+ :bizPath="formComputedData.mediaFileSavePath">
@@ -122,14 +127,14 @@
无文件
+ :bizPath="formComputedData.mediaFileSavePath">
无文件
+ :bizPath="formComputedData.mediaFileSavePath">
@@ -138,7 +143,7 @@
-
+
@@ -163,7 +168,7 @@
无文件
+ :bizPath="formComputedData.mediaFileSavePath">
@@ -212,7 +217,8 @@ const formData = reactive>({
sort: 99,
serviceContent: '',
serviceDuration: '5',
- izEnabled: '2',
+ status: '',
+ izEnabled: '0',
createBy: '',
createTime: '',
updateBy: '',
@@ -229,6 +235,10 @@ const labelCol2 = ref({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref(false);
const isEditMedia = ref(false)
+const instructionTagName = ref('')
+const categoryName = ref('')
+const typeName = ref('')
+const cycleTypeName = ref('')
//表单验证
const validatorRules = reactive({
categoryId: [{ required: true, message: '请选择服务类别!' },],
@@ -296,36 +306,62 @@ function upInstructionDictCode(v_) {
const categoryComDictCode = ref([])
function upCategoryDictCode(v_) {
categoryComDictCode.value = v_
-
}
//服务类型名称
const typeComDictCode = ref([])
function upTypeDictCode(v_) {
typeComDictCode.value = v_
-
}
//周期类型名称
const cycleTypeComDictCode = ref([])
function upCycleTypeDictCode(v_) {
cycleTypeComDictCode.value = v_
-
+}
+//体型标签名称
+const upBodyTagsComDictCode = ref([])
+function upBodyTagsDictCode(v_) {
+ upBodyTagsComDictCode.value = v_
+}
+//情绪标签名称
+const upEmotionTagsComDictCode = ref([])
+function upEmotionTagsDictCode(v_) {
+ upEmotionTagsComDictCode.value = v_
}
-watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode], () => {
- // 当这些字典数据变化时,强制重新计算 directiveBizPath
+
+watch([instructionComDictCode, categoryComDictCode, typeComDictCode, cycleTypeComDictCode, upBodyTagsComDictCode, upEmotionTagsComDictCode], () => {
+ // 当这些字典数据变化时,强制重新计算 formComputedData
}, { deep: true });
-const directiveBizPath = computed(() => {
- if (!canUploadPreviewImage.value) return '';
+const bodyTagsObj = ref([])
+const emotionTagsObj = ref([])
+const formComputedData = computed(() => {
+ if (!canUploadPreviewImage.value) return {};
// 获取各个字段的字典值
- const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
- const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
- const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
- const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.label;
+ const instructionName = instructionComDictCode.value.find(d => d.value == formData.instructionTagId)?.label || '';
+ const categoryName = categoryComDictCode.value.find(d => d.value == formData.categoryId)?.label || '';
+ const typeName = typeComDictCode.value.find(d => d.value == formData.typeId)?.label || '';
+ const cycleTypeName = cycleTypeComDictCode.value.find(d => d.value == formData.cycleType)?.label || '';
- // 构建路径
- return 'directive/' + `${instructionTagName_}/${categoryName_}/${typeName_}/${formData.directiveName}/${cycleTypeName_}`;
+ // 处理标签
+ const processTags = (tags, dict) => {
+ if (!tags) return [];
+ return tags.split(',')
+ .map(id => dict.find(d => d.value === id))
+ .filter(Boolean)
+ .map(item => ({ id: item.value, label: item.label }));
+ };
+
+ return {
+ mediaFileSavePath: `directive/${instructionName}/${categoryName}/${typeName}/${formData.directiveName}/${cycleTypeName}`,
+ instructionName,
+ categoryName,
+ typeName,
+ cycleTypeName,
+ bodyTagsObj: JSON.stringify(processTags(formData.bodyTags, upBodyTagsComDictCode.value)),
+ emotionTagsObj: JSON.stringify(processTags(formData.emotionTags, upEmotionTagsComDictCode.value))
+ };
});
watch(
@@ -398,7 +434,11 @@ async function submitForm() {
confirmLoading.value = true;
const isUpdate = ref(false);
//时间格式化
- let model = formData;
+ const computedData = formComputedData.value;
+ const model = {
+ ...formData,
+ ...computedData
+ };
if (model.id) {
isUpdate.value = true;
}
@@ -418,12 +458,9 @@ async function submitForm() {
if (model.comPrice != 0 && model.tollPrice <= model.comPrice) {
createMessage.warning('提成价格不能高于收费价格!');
confirmLoading.value = false;
- retrun;
+ return
}
- //
- model.mediaFileSavePath = directiveBizPath
-
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
diff --git a/src/views/services/serviceType/ConfigServiceTypeList.vue b/src/views/services/serviceType/ConfigServiceTypeList.vue
index c446421..38a83ff 100644
--- a/src/views/services/serviceType/ConfigServiceTypeList.vue
+++ b/src/views/services/serviceType/ConfigServiceTypeList.vue
@@ -82,14 +82,16 @@ import { ref, reactive, computed, watch } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './ConfigServiceType.data';
-import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ConfigServiceType.api';
+import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './ConfigServiceType.api';
import { defHttp } from '/@/utils/http/axios';
import { downloadFile } from '/@/utils/common/renderUtils';
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
+import { useMessage } from '/@/hooks/web/useMessage';
+const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive({});
const toggleSearchStatus = ref(false);
@@ -207,18 +209,38 @@ function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
+//启用停用
+function handleIzEnabled(record, izEnabled_) {
+ record.izEnabled = izEnabled_
+ saveOrUpdate(record, true).then((res) => {
+ if (res.success) {
+ createMessage.success(res.message);
+ reload();
+ } else {
+ createMessage.warning(res.message);
+ }
+ })
+}
+
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
- label: '编辑',
- onClick: handleEdit.bind(null, record)
- }, {
label: '详情',
onClick: handleDetail.bind(null, record),
- }
+ },
+ {
+ label: '启用',
+ onClick: handleIzEnabled.bind(null, record, '0'),
+ ifShow: record.izEnabled == 1
+ },
+ {
+ label: '停用',
+ onClick: handleIzEnabled.bind(null, record, '1'),
+ ifShow: record.izEnabled == 0
+ },
];
}