临时变更临期提醒配置提交
This commit is contained in:
@@ -16,7 +16,7 @@ export function addSystemConfigApi(data:{group_key:string, label:string,color:st
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 编辑配置项
|
// 编辑配置项
|
||||||
export function editSystemConfigApi(id:number, data:{group_key:string, label:string,color:string,remark?:string,value:string}) {
|
export function editSystemConfigApi(id:number, data:any) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/system-config/${id}`,
|
url: `/api/system-config/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue'
|
|||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { useRouterPush } from '@/hooks/common/router';
|
import { useRouterPush } from '@/hooks/common/router';
|
||||||
import { tagTextColor, tagBgColor, tagBorderColor } from '@/utils/common';
|
import { tagTextColor, tagBgColor, tagBorderColor } from '@/utils/common';
|
||||||
import { systemConfigApi } from '@/service/api/system';
|
import { systemConfigApi, editSystemConfigApi } from '@/service/api/system';
|
||||||
import { myTasksListApi, myTasksWithdrawApi, myTasksCloseApi } from '@/service/api/myTasks';
|
import { myTasksListApi, myTasksWithdrawApi, myTasksCloseApi } from '@/service/api/myTasks';
|
||||||
|
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
@@ -27,7 +27,8 @@ const typeList = ref<any[]>([]);
|
|||||||
// 变更等级
|
// 变更等级
|
||||||
const levelList = ref<any[]>([]);
|
const levelList = ref<any[]>([]);
|
||||||
// 提醒天数
|
// 提醒天数
|
||||||
const remindDays = ref<number>(7);
|
const remindDays = ref<number>(0);
|
||||||
|
const remindInfo = ref<any>(null);
|
||||||
// 源数据
|
// 源数据
|
||||||
const dataSource = ref<any>(null);
|
const dataSource = ref<any>(null);
|
||||||
// 列表
|
// 列表
|
||||||
@@ -171,6 +172,16 @@ const getConfig = async () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const {data,error} = await systemConfigApi();
|
const {data,error} = await systemConfigApi();
|
||||||
if(!error){
|
if(!error){
|
||||||
|
// 解析 临时变更临期提醒
|
||||||
|
const remindDaysGroup = data.find((group:{group_key:string}) => group.group_key === 'change_remind');
|
||||||
|
if (remindDaysGroup) {
|
||||||
|
remindDaysGroup?.items.forEach((item:any) => {
|
||||||
|
if(item.item_key === 'temp_due_remind_days'){
|
||||||
|
remindInfo.value = item;
|
||||||
|
remindDays.value = Number(item.value);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
// 解析 变更类型设置
|
// 解析 变更类型设置
|
||||||
const changeTypeGroup = data.find((group:{group_key:string}) => group.group_key === 'change_type');
|
const changeTypeGroup = data.find((group:{group_key:string}) => group.group_key === 'change_type');
|
||||||
if (changeTypeGroup) {
|
if (changeTypeGroup) {
|
||||||
@@ -185,6 +196,15 @@ const getConfig = async () => {
|
|||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
// 更新提醒天数
|
||||||
|
const updateRemindDays = async () => {
|
||||||
|
const {error} = await editSystemConfigApi(remindInfo.value?.id,{
|
||||||
|
label: remindInfo.value?.label,
|
||||||
|
color: remindInfo.value?.color,
|
||||||
|
remark: remindInfo.value?.remark,
|
||||||
|
value: remindDays.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getConfig();
|
getConfig();
|
||||||
@@ -248,7 +268,7 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
<Icon icon="lets-icons:clock" class="size-16px text-amber-600" />
|
<Icon icon="lets-icons:clock" class="size-16px text-amber-600" />
|
||||||
临时变更临期提醒:到期前
|
临时变更临期提醒:到期前
|
||||||
<NInputNumber v-model:value="remindDays" :min="1" :max="30" size="tiny" placeholder="" :show-button="false" class="text-11px w-14 text-center" />
|
<NInputNumber v-model:value="remindDays" :min="1" size="tiny" placeholder="" :show-button="false" class="text-11px w-14 text-center" @blur="updateRemindDays" />
|
||||||
天提醒(可设置)· 超期红色、临期琥珀色标识
|
天提醒(可设置)· 超期红色、临期琥珀色标识
|
||||||
<span class="ml-auto">
|
<span class="ml-auto">
|
||||||
共 {{tabCount["all"]}} 项 · 点击行内按钮办理各阶段业务
|
共 {{tabCount["all"]}} 项 · 点击行内按钮办理各阶段业务
|
||||||
|
|||||||
Reference in New Issue
Block a user