|
|
@@ -57,6 +57,7 @@
|
|
|
size="small"
|
|
|
style="height: 16px; margin-left: 12px"
|
|
|
/>
|
|
|
+ <div v-show="showError === true && currentSet === 'atExpiry'" class="subtitle_error">{{ errorMessage }}</div>
|
|
|
</div>
|
|
|
<div
|
|
|
v-show="props.issueType != QuestionStatus.finishe"
|
|
|
@@ -72,6 +73,7 @@
|
|
|
size="small"
|
|
|
style="width: 70px; margin-left: 4px; margin-right: 4px"
|
|
|
controls-position="right"
|
|
|
+ @change="currentSet = 'atExpiry'"
|
|
|
/>小时未{{ props.title }}继续推送给{{ props.title }}员</div
|
|
|
>
|
|
|
<div v-show="props.issueType != QuestionStatus.finishe" class="subtitle"
|
|
|
@@ -82,6 +84,9 @@
|
|
|
size="small"
|
|
|
style="height: 16px; margin-left: 12px"
|
|
|
/>
|
|
|
+ <div v-show="showError === true && currentSet === 'atLongTimeExpiry'" class="subtitle_error">
|
|
|
+ {{ errorMessage }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div
|
|
|
v-show="props.issueType != QuestionStatus.finishe"
|
|
|
@@ -97,6 +102,7 @@
|
|
|
size="small"
|
|
|
style="width: 70px; margin-left: 4px; margin-right: 4px"
|
|
|
controls-position="right"
|
|
|
+ @change="currentSet = 'atLongTimeExpiry'"
|
|
|
/>小时未{{ props.title }}再次推送给{{ props.title }}员并抄送给
|
|
|
<el-select
|
|
|
:disabled="!editDetails.openEdit || !editDetails.atLongTimeExpiry"
|
|
|
@@ -147,9 +153,10 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { panelDetails, QuestionStatus, issueDetilasType, PushTypeStatus } from '../type';
|
|
|
import { EditPen } from '@element-plus/icons-vue';
|
|
|
- import { ref, watch } from 'vue';
|
|
|
+ import { ref, watch, computed } from 'vue';
|
|
|
import { SelectedFilterPersonInfo } from '@/api/message/person-group';
|
|
|
import PersonFilterSelection from '@/views/message/components/PersonFilterSelection.vue';
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
|
|
|
const props = defineProps<{
|
|
|
savedData: Array<issueDetilasType>;
|
|
|
@@ -174,6 +181,10 @@
|
|
|
editDetails.value.openEdit = true;
|
|
|
};
|
|
|
const saveQuestionEdit = () => {
|
|
|
+ if (showError.value) {
|
|
|
+ ElMessage.error('保存失败');
|
|
|
+ return;
|
|
|
+ }
|
|
|
props.saveUpdate(editDetails.value, props.issueType);
|
|
|
editDetails.value.openEdit = false;
|
|
|
};
|
|
|
@@ -181,6 +192,43 @@
|
|
|
const dialogVisible = ref<boolean>(false);
|
|
|
const selectedUser = ref<SelectedFilterPersonInfo[]>([]);
|
|
|
|
|
|
+ //是否显示错误提示
|
|
|
+ const showError = ref<boolean>(false);
|
|
|
+ //该值为atExpiry或atLongTimeExpiry
|
|
|
+ const currentSet = ref('atExpiry');
|
|
|
+
|
|
|
+ const errorMessage = computed(() => {
|
|
|
+ if (editDetails.value.atExpiry && editDetails.value.atLongTimeExpiry) {
|
|
|
+ if (
|
|
|
+ editDetails.value.expiryTime! > editDetails.value.longTimeValue! ||
|
|
|
+ editDetails.value.expiryTime! === editDetails.value.longTimeValue!
|
|
|
+ ) {
|
|
|
+ if (currentSet.value === 'atExpiry') {
|
|
|
+ showError.value = true;
|
|
|
+ return '超期时长应小于长期时长';
|
|
|
+ } else {
|
|
|
+ showError.value = true;
|
|
|
+ return '长期时长应大于超期时长';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (editDetails.value.atExpiry && currentSet.value === 'atExpiry' && editDetails.value.expiryTime === 0) {
|
|
|
+ showError.value = true;
|
|
|
+ return '超期时长不可为0';
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ editDetails.value.atLongTimeExpiry &&
|
|
|
+ currentSet.value === 'atLongTimeExpiry' &&
|
|
|
+ editDetails.value.longTimeValue === 0
|
|
|
+ ) {
|
|
|
+ showError.value = true;
|
|
|
+ return '长期时长不可为0';
|
|
|
+ }
|
|
|
+ //上面的条件一个都不满足时
|
|
|
+ showError.value = false;
|
|
|
+ return '';
|
|
|
+ });
|
|
|
+
|
|
|
const openNameTree = () => {
|
|
|
//如果非编辑状态或长期的开关处于关闭状态则什么都不干
|
|
|
if (!editDetails.value.atLongTimeExpiry || !editDetails.value.openEdit) {
|
|
|
@@ -286,6 +334,14 @@
|
|
|
text-align: left;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
+ .subtitle_error {
|
|
|
+ height: 100%;
|
|
|
+ color: red;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 10px;
|
|
|
+ line-height: 15px;
|
|
|
+ margin-left: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
.subtitle_explain_disable {
|
|
|
height: 21px;
|
|
|
@@ -314,4 +370,8 @@
|
|
|
:deep(.el-textarea__inner) {
|
|
|
font-size: 10px;
|
|
|
}
|
|
|
+ :deep(.el-input-number.is-controls-right .el-input__wrapper) {
|
|
|
+ padding-left: 0;
|
|
|
+ padding-right: 24px;
|
|
|
+ }
|
|
|
</style>
|