服务指令功能完善
This commit is contained in:
parent
bcfabb7667
commit
3e7639ad74
|
@ -24,7 +24,7 @@ export default defineComponent({
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['change', 'update:value'],
|
emits: ['change', 'update:value', 'upDictCode'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
//checkbox选项
|
//checkbox选项
|
||||||
|
@ -86,6 +86,7 @@ export default defineComponent({
|
||||||
if (res) {
|
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 }));
|
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);
|
//console.info('res', dictOptions.value);
|
||||||
|
emit('upDictCode', checkOptions.value)
|
||||||
} else {
|
} else {
|
||||||
console.error('getDictItems error: : ', res);
|
console.error('getDictItems error: : ', res);
|
||||||
checkOptions.value = [];
|
checkOptions.value = [];
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
<a-select-option :value="item.value" :disabled="!ignoreDisabled && item.disabled">
|
<a-select-option :value="item.value" :disabled="!ignoreDisabled && item.disabled">
|
||||||
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
<span :class="[useDicColor && item.color ? 'colorText' : '']"
|
||||||
:style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
|
:style="{ backgroundColor: `${useDicColor && item.color}` }" :title="item.label">
|
||||||
{{ item.label }}<span style="color:rgb(255 39 39);">{{ ignoreDisabled && item.disabled ? '(已停用)' : '' }}</span>
|
{{ item.label }}<span style="color:rgb(255 39 39);">{{ ignoreDisabled && item.disabled ? '(已停用)' : ''
|
||||||
|
}}</span>
|
||||||
</span>
|
</span>
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</template>
|
</template>
|
||||||
|
@ -77,7 +78,7 @@ export default defineComponent({
|
||||||
style: propTypes.any,
|
style: propTypes.any,
|
||||||
ignoreDisabled: propTypes.bool.def(false),
|
ignoreDisabled: propTypes.bool.def(false),
|
||||||
},
|
},
|
||||||
emits: ['options-change', 'change', 'update:value'],
|
emits: ['options-change', 'change', 'update:value', 'upDictCode'],
|
||||||
setup(props, { emit, refs }) {
|
setup(props, { emit, refs }) {
|
||||||
const dictOptions = ref<any[]>([]);
|
const dictOptions = ref<any[]>([]);
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
@ -140,6 +141,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
return prev;
|
return prev;
|
||||||
}, []);
|
}, []);
|
||||||
|
emit('upDictCode', dictOptions.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleChange(e) {
|
function handleChange(e) {
|
||||||
|
|
|
@ -74,13 +74,15 @@ import { ref, reactive } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './InstructionTag.data';
|
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 { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import InstructionTagModal from './components/InstructionTagModal.vue'
|
import InstructionTagModal from './components/InstructionTagModal.vue'
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
const { createMessage } = useMessage();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
@ -186,19 +188,38 @@ function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(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) {
|
function getTableAction(record) {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record)
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
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
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,13 +82,15 @@ import { ref, reactive } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './ConfigServiceCategory.data';
|
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 { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import ConfigServiceCategoryModal from './components/ConfigServiceCategoryModal.vue'
|
import ConfigServiceCategoryModal from './components/ConfigServiceCategoryModal.vue'
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
const { createMessage } = useMessage();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
@ -194,19 +196,38 @@ function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(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) {
|
function getTableAction(record) {
|
||||||
return [
|
return [
|
||||||
{
|
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record)
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
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
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,12 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'serviceDuration',
|
dataIndex: 'serviceDuration',
|
||||||
width: 135,
|
width: 135,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '指令状态',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'status_dictText',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '是否启用',
|
title: '是否启用',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<a-col :lg="6">
|
<a-col :lg="6">
|
||||||
<a-form-item name="izEnabled">
|
<a-form-item name="izEnabled">
|
||||||
<template #label><span title="是否启用">是否启用</span></template>
|
<template #label><span title="是否启用">是否启用</span></template>
|
||||||
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="directive_status"
|
<j-dict-select-tag type='list' v-model:value="queryParam.izEnabled" dictCode="iz_enabled"
|
||||||
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
:ignoreDisabled="true" placeholder="请选择是否启用" allowClear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
|
@ -10,28 +10,31 @@
|
||||||
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
id="ConfigServiceDirectiveForm-instructionTagId" name="instructionTagId">
|
||||||
<j-dict-select-tag v-model:value="formData.instructionTagId"
|
<j-dict-select-tag v-model:value="formData.instructionTagId"
|
||||||
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 order by sort asc`"
|
||||||
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode" />
|
placeholder="请选择分类标签" allowClear @upDictCode="upInstructionDictCode"
|
||||||
|
:disabled="!!formData.id && formData.status == 0" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
<a-form-item label="服务类别" v-bind="validateInfos.categoryId" id="ConfigServiceDirectiveForm-categoryId"
|
||||||
name="categoryId">
|
name="categoryId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
<j-dict-select-tag type="list" v-model:value="formData.categoryId"
|
||||||
:disabled="!formData.instructionTagId" :dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear
|
:disabled="!formData.instructionTagId || (!!formData.id && formData.status == 0)"
|
||||||
@upDictCode="upCategoryDictCode" />
|
:dictCode="categoryDictCode" placeholder="请选择服务类别" allow-clear @upDictCode="upCategoryDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
<a-form-item label="服务类型" v-bind="validateInfos.typeId" id="ConfigServiceDirectiveForm-typeId"
|
||||||
name="typeId">
|
name="typeId">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
<j-dict-select-tag type="list" v-model:value="formData.typeId" :dictCode="typeDictCode"
|
||||||
:disabled="!formData.categoryId" placeholder="请选择服务类型" allowClear @upDictCode="upTypeDictCode" />
|
:disabled="!formData.categoryId || (!!formData.id && formData.status == 0)" placeholder="请选择服务类型"
|
||||||
|
allowClear @upDictCode="upTypeDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName"
|
<a-form-item label="服务指令名称" v-bind="validateInfos.directiveName"
|
||||||
id="ConfigServiceDirectiveForm-directiveName" name="directiveName">
|
id="ConfigServiceDirectiveForm-directiveName" name="directiveName">
|
||||||
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear></a-input>
|
<a-input v-model:value="formData.directiveName" placeholder="请输入服务指令名称" allow-clear
|
||||||
|
:disabled="!!formData.id && formData.status == 0"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -66,7 +69,8 @@
|
||||||
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
<a-form-item label="周期类型" v-bind="validateInfos.cycleType" id="ConfigServiceDirectiveForm-cycleType"
|
||||||
name="cycleType">
|
name="cycleType">
|
||||||
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
<j-dict-select-tag type="list" v-model:value="formData.cycleType" dictCode="period_type"
|
||||||
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode" />
|
placeholder="请选择周期类型" allowClear @upDictCode="upCycleTypeDictCode"
|
||||||
|
:disabled="!!formData.id && formData.status == 0" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
|
@ -82,30 +86,31 @@
|
||||||
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
<a-form-item label="体型标签" id="ConfigServiceDirectiveForm-typeId" :labelCol="labelCol2"
|
||||||
:wrapperCol="wrapperCol2" name="typeId">
|
:wrapperCol="wrapperCol2" name="typeId">
|
||||||
<JCheckbox v-model:value="formData.bodyTags"
|
<JCheckbox v-model:value="formData.bodyTags"
|
||||||
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
:dictCode="`nu_config_body_tag,tag_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
@upDictCode="upBodyTagsDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
|
<a-form-item label="情绪标签" :labelCol="labelCol2" :wrapperCol="wrapperCol2" name="emoTags">
|
||||||
<JCheckbox v-model:value="formData.emotionTags"
|
<JCheckbox v-model:value="formData.emotionTags"
|
||||||
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`" />
|
:dictCode="`nu_config_emotion_tag,tag_name,id,del_flag = 0 order by sort asc`"
|
||||||
|
@upDictCode="upEmotionTagsDictCode" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
|
<a-form-item label="是否启用" v-bind="validateInfos.izEnabled" id="ConfigServiceDirectiveForm-izEnabled"
|
||||||
name="izEnabled">
|
name="izEnabled">
|
||||||
<span v-if="formData.izEnabled == 2">未授权</span>
|
<j-dict-select-tag type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
||||||
<j-dict-select-tag v-else type='radio' v-model:value="formData.izEnabled" dictCode="iz_enabled"
|
|
||||||
placeholder="请选择是否启用" allowClear />
|
placeholder="请选择是否启用" allowClear />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row v-if="formData.izEnabled == 0 || formData.izEnabled == 1">
|
<a-row v-if="disabled">
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
<a-form-item label="服务指令图片" v-bind="validateInfos.previewFile">
|
||||||
<span v-if="!formData.previewFile">无文件</span>
|
<span v-if="!formData.previewFile">无文件</span>
|
||||||
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile" disabled
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.previewFile" disabled
|
||||||
:bizPath="directiveBizPath">
|
:bizPath="formComputedData.mediaFileSavePath">
|
||||||
</JImageUpload>
|
</JImageUpload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -122,14 +127,14 @@
|
||||||
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
<a-form-item label="指令音频文件" v-bind="validateInfos.mp3File" id="ConfigServiceDirectiveForm-mp3File">
|
||||||
<span v-if="!formData.mp3File">无文件</span>
|
<span v-if="!formData.mp3File">无文件</span>
|
||||||
<j-upload v-else v-model:value="formData.mp3File" accept=".mp3" :maxCount="1" disabled
|
<j-upload v-else v-model:value="formData.mp3File" accept=".mp3" :maxCount="1" disabled
|
||||||
:bizPath="directiveBizPath"></j-upload>
|
:bizPath="formComputedData.mediaFileSavePath"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
<a-form-item label="指令视频文件" v-bind="validateInfos.mp4File" id="ConfigServiceDirectiveForm-mp4File">
|
||||||
<span v-if="!formData.mp4File">无文件</span>
|
<span v-if="!formData.mp4File">无文件</span>
|
||||||
<j-upload v-else v-model:value="formData.mp4File" accept=".mp4" :maxCount="1" disabled
|
<j-upload v-else v-model:value="formData.mp4File" accept=".mp4" :maxCount="1" disabled
|
||||||
:bizPath="directiveBizPath"></j-upload>
|
:bizPath="formComputedData.mediaFileSavePath"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-row>
|
<a-row>
|
||||||
|
@ -138,7 +143,7 @@
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
</JFormContainer>
|
</JFormContainer>
|
||||||
<JFormContainer v-if="formData.izEnabled == 0 || formData.izEnabled == 1">
|
<JFormContainer v-if="disabled">
|
||||||
<template #detail>
|
<template #detail>
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||||
name="ConfigServiceDirectiveForm">
|
name="ConfigServiceDirectiveForm">
|
||||||
|
@ -163,7 +168,7 @@
|
||||||
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
<a-form-item label="即时指令图标" v-bind="validateInfos.immediateFile">
|
||||||
<span v-if="!formData.immediateFile">无文件</span>
|
<span v-if="!formData.immediateFile">无文件</span>
|
||||||
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile" disabled
|
<JImageUpload v-else :fileMax="1" v-model:value="formData.immediateFile" disabled
|
||||||
:bizPath="directiveBizPath">
|
:bizPath="formComputedData.mediaFileSavePath">
|
||||||
</JImageUpload>
|
</JImageUpload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -212,7 +217,8 @@ const formData = reactive<Record<string, any>>({
|
||||||
sort: 99,
|
sort: 99,
|
||||||
serviceContent: '',
|
serviceContent: '',
|
||||||
serviceDuration: '5',
|
serviceDuration: '5',
|
||||||
izEnabled: '2',
|
status: '',
|
||||||
|
izEnabled: '0',
|
||||||
createBy: '',
|
createBy: '',
|
||||||
createTime: '',
|
createTime: '',
|
||||||
updateBy: '',
|
updateBy: '',
|
||||||
|
@ -229,6 +235,10 @@ const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
|
||||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
||||||
const confirmLoading = ref<boolean>(false);
|
const confirmLoading = ref<boolean>(false);
|
||||||
const isEditMedia = ref(false)
|
const isEditMedia = ref(false)
|
||||||
|
const instructionTagName = ref('')
|
||||||
|
const categoryName = ref('')
|
||||||
|
const typeName = ref('')
|
||||||
|
const cycleTypeName = ref('')
|
||||||
//表单验证
|
//表单验证
|
||||||
const validatorRules = reactive({
|
const validatorRules = reactive({
|
||||||
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
categoryId: [{ required: true, message: '请选择服务类别!' },],
|
||||||
|
@ -296,36 +306,62 @@ function upInstructionDictCode(v_) {
|
||||||
const categoryComDictCode = ref([])
|
const categoryComDictCode = ref([])
|
||||||
function upCategoryDictCode(v_) {
|
function upCategoryDictCode(v_) {
|
||||||
categoryComDictCode.value = v_
|
categoryComDictCode.value = v_
|
||||||
|
|
||||||
}
|
}
|
||||||
//服务类型名称
|
//服务类型名称
|
||||||
const typeComDictCode = ref([])
|
const typeComDictCode = ref([])
|
||||||
function upTypeDictCode(v_) {
|
function upTypeDictCode(v_) {
|
||||||
typeComDictCode.value = v_
|
typeComDictCode.value = v_
|
||||||
|
|
||||||
}
|
}
|
||||||
//周期类型名称
|
//周期类型名称
|
||||||
const cycleTypeComDictCode = ref([])
|
const cycleTypeComDictCode = ref([])
|
||||||
function upCycleTypeDictCode(v_) {
|
function upCycleTypeDictCode(v_) {
|
||||||
cycleTypeComDictCode.value = 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 });
|
}, { deep: true });
|
||||||
|
|
||||||
const directiveBizPath = computed(() => {
|
const bodyTagsObj = ref([])
|
||||||
if (!canUploadPreviewImage.value) return '';
|
const emotionTagsObj = ref([])
|
||||||
|
const formComputedData = computed(() => {
|
||||||
|
if (!canUploadPreviewImage.value) return {};
|
||||||
|
|
||||||
// 获取各个字段的字典值
|
// 获取各个字段的字典值
|
||||||
const instructionTagName_ = instructionComDictCode.value.filter(d => d.value == formData.instructionTagId)?.[0]?.label;
|
const instructionName = instructionComDictCode.value.find(d => d.value == formData.instructionTagId)?.label || '';
|
||||||
const categoryName_ = categoryComDictCode.value.filter(d => d.value == formData.categoryId)?.[0]?.label;
|
const categoryName = categoryComDictCode.value.find(d => d.value == formData.categoryId)?.label || '';
|
||||||
const typeName_ = typeComDictCode.value.filter(d => d.value == formData.typeId)?.[0]?.label;
|
const typeName = typeComDictCode.value.find(d => d.value == formData.typeId)?.label || '';
|
||||||
const cycleTypeName_ = cycleTypeComDictCode.value.filter(d => d.value == formData.cycleType)?.[0]?.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(
|
watch(
|
||||||
|
@ -398,7 +434,11 @@ async function submitForm() {
|
||||||
confirmLoading.value = true;
|
confirmLoading.value = true;
|
||||||
const isUpdate = ref<boolean>(false);
|
const isUpdate = ref<boolean>(false);
|
||||||
//时间格式化
|
//时间格式化
|
||||||
let model = formData;
|
const computedData = formComputedData.value;
|
||||||
|
const model = {
|
||||||
|
...formData,
|
||||||
|
...computedData
|
||||||
|
};
|
||||||
if (model.id) {
|
if (model.id) {
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
}
|
}
|
||||||
|
@ -418,12 +458,9 @@ async function submitForm() {
|
||||||
if (model.comPrice != 0 && model.tollPrice <= model.comPrice) {
|
if (model.comPrice != 0 && model.tollPrice <= model.comPrice) {
|
||||||
createMessage.warning('提成价格不能高于收费价格!');
|
createMessage.warning('提成价格不能高于收费价格!');
|
||||||
confirmLoading.value = false;
|
confirmLoading.value = false;
|
||||||
retrun;
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
model.mediaFileSavePath = directiveBizPath
|
|
||||||
|
|
||||||
await saveOrUpdate(model, isUpdate.value)
|
await saveOrUpdate(model, isUpdate.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|
|
@ -82,14 +82,16 @@ import { ref, reactive, computed, watch } from 'vue';
|
||||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { columns, superQuerySchema } from './ConfigServiceType.data';
|
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 { defHttp } from '/@/utils/http/axios';
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.vue'
|
import ConfigServiceTypeModal from './components/ConfigServiceTypeModal.vue'
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
const { createMessage } = useMessage();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
|
@ -207,18 +209,38 @@ function handleSuccess() {
|
||||||
(selectedRowKeys.value = []) && reload();
|
(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) {
|
function getTableAction(record) {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: '编辑',
|
|
||||||
onClick: handleEdit.bind(null, record)
|
|
||||||
}, {
|
|
||||||
label: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
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
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue