服务指令包:

1、只能添加日常、周期类型服务指令
2、添加周期类型服务指令时必须选择周几或每月几号
This commit is contained in:
1378012178@qq.com 2025-11-11 08:36:20 +08:00
parent 5edd47c1c9
commit bdae86f664
1 changed files with 138 additions and 8 deletions

View File

@ -10,8 +10,7 @@
<template #label><span title="分类标签">分类标签</span></template>
<j-dict-select-tag v-model:value="queryParam.instructionTagId"
:dictCode="`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
placeholder="请选择分类标签" allowClear :ignoreDisabled="true"
@change="onInstructionTagChange" />
placeholder="请选择分类标签" allowClear :ignoreDisabled="true" @change="onInstructionTagChange" />
</a-form-item>
</a-col>
@ -20,8 +19,7 @@
<template #label><span title="服务类别">服务类别</span></template>
<j-dict-select-tag type="list" v-model:value="queryParam.categoryId"
:dictCode="`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
placeholder="请选择服务类别" allowClear :ignoreDisabled="true"
@change="onCategoryChange" />
placeholder="请选择服务类别" allowClear :ignoreDisabled="true" @change="onCategoryChange" />
</a-form-item>
</a-col>
@ -44,7 +42,8 @@
<a-col :xl="4" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
@ -104,6 +103,66 @@
</a-col>
</a-row>
<!-- 弹窗选择周几或每月几号 -->
<a-modal v-model:visible="isModalVisible" title="选择周期" @ok="onConfirm" @cancel="onCancel" width="600px">
<div class="modal-content">
<a-radio-group v-model:value="cycleType">
<a-radio value="week">每周</a-radio>
<a-radio value="month">每月</a-radio>
</a-radio-group>
<!-- 周期选择每周 -->
<div v-if="cycleType === 'week'" class="week-selection">
<a-radio-group v-model:value="selectedDays">
<a-radio value="0">周一</a-radio>
<a-radio value="1">周二</a-radio>
<a-radio value="2">周三</a-radio>
<a-radio value="3">周四</a-radio>
<a-radio value="4">周五</a-radio>
<a-radio value="5">周六</a-radio>
<a-radio value="6">周日</a-radio>
</a-radio-group>
</div>
<!-- 周期选择每月 -->
<div v-if="cycleType === 'month'" class="month-selection">
<a-radio-group v-model:value="selectedDaysInMonth">
<a-radio value="01">01</a-radio>
<a-radio value="02">02</a-radio>
<a-radio value="03">03</a-radio>
<a-radio value="04">04</a-radio>
<a-radio value="05">05</a-radio>
<a-radio value="06">06</a-radio>
<a-radio value="07">07</a-radio>
<a-radio value="08">08</a-radio>
<a-radio value="09">09</a-radio>
<a-radio value="10">10</a-radio>
<a-radio value="11">11</a-radio>
<a-radio value="12">12</a-radio>
<a-radio value="13">13</a-radio>
<a-radio value="14">14</a-radio>
<a-radio value="15">15</a-radio>
<a-radio value="16">16</a-radio>
<a-radio value="17">17</a-radio>
<a-radio value="18">18</a-radio>
<a-radio value="19">19</a-radio>
<a-radio value="20">20</a-radio>
<a-radio value="21">21</a-radio>
<a-radio value="22">22</a-radio>
<a-radio value="23">23</a-radio>
<a-radio value="24">24</a-radio>
<a-radio value="25">25</a-radio>
<a-radio value="26">26</a-radio>
<a-radio value="27">27</a-radio>
<a-radio value="28">28</a-radio>
<a-radio value="29">29</a-radio>
<a-radio value="30">30</a-radio>
<a-radio value="31">31</a-radio>
</a-radio-group>
</div>
</div>
</a-modal>
<!-- 表单弹窗 -->
<ConfigServiceDirectiveModal ref="registerModal" @success="handleSuccess" />
</div>
@ -128,6 +187,10 @@ const queryParam = reactive<any>({});
const registerModal = ref();
const directiveInfo = ref<any>({});
const checkListData = ref<any>([]);
const isModalVisible = ref(false); //
const cycleType = ref('week'); // week month
const selectedDays = ref<number[]>([]); //
const selectedDaysInMonth = ref<number | null>(null); //
//
const props = defineProps({
@ -170,6 +233,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
beforeFetch: async (params) => {
params.column = 'createTime';
params.order = 'desc';
params.cycleType = '1,2'
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery);
},
@ -188,10 +252,53 @@ function handleSuccess() {
/**
* 选择指令
*/
// function handleCheck(record) {
// console.log("🚀 ~ handleSelect ~ record:", record)
// checkListData.value.push(record);
// emit('checkDirective', checkListData.value);
// }
function handleCheck(record) {
console.log("🚀 ~ handleSelect ~ record:", record)
checkListData.value.push(record);
emit('checkDirective', checkListData.value);
if (record.cycleType == 2) {
isModalVisible.value = true;
//
directiveInfo.value = record;
} else {
checkListData.value.push(record);
emit('checkDirective', checkListData.value);
}
}
//
function onConfirm() {
if (cycleType.value === 'week' && selectedDays.value.length === 0) {
alert('请至少选择一个星期几');
return;
}
if (cycleType.value === 'month' && (!selectedDaysInMonth.value || selectedDaysInMonth.value.length === 0)) {
alert('请至少选择一个日期');
return;
}
//
let content_ = [{
...directiveInfo.value
}]
if (cycleType.value === 'week') {
content_[0].cycleTypeShow = '每周'
content_[0].cycleTypeValue = selectedDays.value[0]
}
if (cycleType.value === 'month') {
content_[0].cycleTypeShow = '每月'
content_[0].cycleTypeValue = selectedDaysInMonth.value
}
checkListData.value.push(content_[0]);
isModalVisible.value = false; //
emit('checkDirective', checkListData.value); //
}
//
function onCancel() {
isModalVisible.value = false; //
}
/**
@ -329,4 +436,27 @@ audio::-webkit-media-controls-time-remaining-display {
:deep(.ant-table-title) {
display: none !important;
}
.modal-content {
padding: 16px;
}
.week-selection,
.month-selection {
margin-top: 16px;
}
a-radio-group {
margin-bottom: 16px;
}
a-checkbox-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
a-checkbox {
margin-bottom: 8px;
}
</style>