generated from Leo_Ding/web-template
Merge branch 'master' of https://gitlab.guxuan.icu/Leo_Ding/hahaPension_admin
This commit is contained in:
commit
09f0c040e8
@ -397,23 +397,22 @@ function handleDelete({ id }) {
|
||||
content: t('button.confirm'),
|
||||
okText: t('button.confirm'),
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { success } = await apis.productOrder.delItem(id).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
if (config('http.code.success') === success) {
|
||||
resolve()
|
||||
message.success(t('component.message.success.delete'))
|
||||
await getPageList()
|
||||
}
|
||||
} catch (error) {
|
||||
reject()
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const res = await apis.serviceStaffList.delItem(id);
|
||||
if (config('http.code.success') === res.success) {
|
||||
message.success(t('component.message.success.delete'));
|
||||
await getPageList();
|
||||
resolve();
|
||||
} else {
|
||||
reject(new Error('API returned failure'));
|
||||
}
|
||||
})()
|
||||
})
|
||||
},
|
||||
} catch (error) {
|
||||
message.error(t('component.message.error.delete'));
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -119,14 +119,21 @@ function handleOk() {
|
||||
break
|
||||
}
|
||||
hideLoading()
|
||||
if (config('http.code.success') === true) {
|
||||
|
||||
// 修改这里:检查请求是否成功
|
||||
if (result && config('http.code.success') === result.success) {
|
||||
hideModal()
|
||||
// 触发列表刷新
|
||||
emit('ok')
|
||||
// 可以添加成功提示
|
||||
message.success('操作成功')
|
||||
} else {
|
||||
message.error('操作失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error.message)
|
||||
hideLoading()
|
||||
// message.error(error.message)
|
||||
message.error('操作失败')
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@ -363,7 +363,7 @@
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
|
||||
<detail ref="detailRef"></detail>
|
||||
<LineOrder2 ref="lineOrderRef" />
|
||||
<TransferOut ref="transferRef" />
|
||||
<TransferOut ref="transferRef" @ok="onOk" />
|
||||
<!-- <a-drawer v-model:open="lineOpen" class="custom-class" width="600" root-class-name="root-class-name" :root-style="{ color: 'blue' }" :title="lineTitle" placement="right">
|
||||
<LineOrder ref="lineOrderRef" />
|
||||
</a-drawer> -->
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="等级" name="level">
|
||||
<a-select v-model:value="searchFormData.orgLv">
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.level" :key="item.dval"
|
||||
<a-select-option v-for="item in dicsStore.dictOptions.Level" :key="item.dval"
|
||||
:value="item.dval">
|
||||
{{ item.introduction }}
|
||||
</a-select-option>
|
||||
@ -263,37 +263,38 @@ function handleDetail(record) {
|
||||
|
||||
// 启用/停用
|
||||
function handleToggleStatus(record) {
|
||||
const isEnable = record.status !== '2'; // 当前不是启用 → 要启用
|
||||
const actionText = isEnable ? '启用' : '停用';
|
||||
const confirmText = isEnable ? '确定要启用该组织吗?' : '确定要停用该组织吗?';
|
||||
console.log("==record===", record);
|
||||
|
||||
Modal.confirm({
|
||||
title: `${actionText}组织`,
|
||||
content: confirmText,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
okType: isEnable ? 'primary' : 'danger',
|
||||
onOk: async () => {
|
||||
try {
|
||||
// ✅ 正确传参:id + { status: '1' 或 '2' }
|
||||
const { success } = await apis.serviceMenu.enableOrDisable(
|
||||
record.id,
|
||||
{ status: isEnable ? '1' : '2' }
|
||||
);
|
||||
const isCurrentlyEnabled = record.status === '1'; // 假设 '1'=启用, '2'=停用
|
||||
|
||||
if (success) {
|
||||
message.success(`${actionText}成功`);
|
||||
// 更新本地状态
|
||||
getList()
|
||||
} else {
|
||||
message.error(`${actionText}失败`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('操作异常:', error);
|
||||
message.error('操作失败');
|
||||
}
|
||||
const actionText = isCurrentlyEnabled ? '停用' : '启用';
|
||||
const confirmText = `确定要${actionText}该组织吗?`;
|
||||
const newStatus = isCurrentlyEnabled ? '2' : '1'; // 切换状态
|
||||
|
||||
Modal.confirm({
|
||||
title: `${actionText}组织`,
|
||||
content: confirmText,
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
okType: isCurrentlyEnabled ? 'danger' : 'primary', // 停用用红色,启用用蓝色
|
||||
onOk: async () => {
|
||||
try {
|
||||
const { success } = await apis.serviceMenu.enableOrDisable(record.id, {
|
||||
status: newStatus,
|
||||
});
|
||||
|
||||
if (success) {
|
||||
message.success(`${actionText}成功`);
|
||||
getList(); // 刷新列表
|
||||
} else {
|
||||
message.error(`${actionText}失败`);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('操作异常:', error);
|
||||
message.error('操作失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// 设备管理
|
||||
|
||||
@ -118,13 +118,14 @@
|
||||
<a-card class="mb-4" title="服务信息" style="margin-top: 20px">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="营业时间" name="openTime">
|
||||
<div style="display: flex; gap: 8px">
|
||||
<a-time-picker v-model:value="formData.openTime" format="HH:mm" placeholder="开始时间"
|
||||
:disabled="isViewMode" />
|
||||
<a-time-picker v-model:value="formData.closeTime" format="HH:mm" placeholder="结束时间"
|
||||
:disabled="isViewMode" />
|
||||
</div>
|
||||
<a-form-item label="营业开始时间" name="openAt" required>
|
||||
<a-time-picker v-model:value="formData.openAt" format="HH:mm" placeholder="开始时间" :disabled="isViewMode" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="营业结束时间" name="closeAt" required>
|
||||
<a-time-picker v-model:value="formData.closeAt" format="HH:mm" placeholder="结束时间"
|
||||
:disabled="isViewMode" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
@ -198,11 +199,14 @@ import { useDicsStore } from '@/store'
|
||||
import AreaCascader from '@/components/AreaCascader/index.vue'
|
||||
import UploadInput from '@/components/Upload/UploadInput.vue'
|
||||
import { getBirthDate, spliceUrl } from '@/utils/util'
|
||||
import dayjs from 'dayjs'
|
||||
import { config } from '@/config'
|
||||
const emit = defineEmits(['ok'])
|
||||
const { t } = useI18n()
|
||||
const { modal, showModal, hideModal } = useModal()
|
||||
const { formData, formRef, resetForm } = useForm()
|
||||
|
||||
|
||||
// 初始化表单数据
|
||||
const initFormData = () => ({
|
||||
id: undefined,
|
||||
@ -240,6 +244,8 @@ const rules = {
|
||||
code: [{ required: true, message: '请输入机构代码', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '请选择站点类型', trigger: 'change' }],
|
||||
manager: [{ required: true, message: '请输入负责人姓名', trigger: 'blur' }],
|
||||
openAt: [{ required: true, message: '请选择营业开始时间', trigger: 'change' }],
|
||||
closeAt: [{ required: true, message: '请选择营业结束时间', trigger: 'change' }],
|
||||
phone: [
|
||||
{ required: true, message: '请输入联系电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' },
|
||||
@ -337,8 +343,8 @@ async function loadRecord(id, forView = false) {
|
||||
buildTime: record.completionAt ? dayjs(record.completionAt) : null,
|
||||
area: record.area || 0,
|
||||
description: record.content || '',
|
||||
openTime: record.openAt ? dayjs(`1970-01-01 ${record.openAt}`) : null,
|
||||
closeTime: record.closeAt ? dayjs(`1970-01-01 ${record.closeAt}`) : null,
|
||||
openAt: record.openAt ? dayjs(`1970-01-01 ${record.openAt}`) : null,
|
||||
closeAt: record.closeAt ? dayjs(`1970-01-01 ${record.closeAt}`) : null,
|
||||
|
||||
status: record.status || '',
|
||||
services: record.provideServices || [],
|
||||
@ -388,8 +394,8 @@ async function handleOk() {
|
||||
CompletionAt: values.buildTime ? values.buildTime.toDate() : null,
|
||||
Area: values.area || 0,
|
||||
Content: values.description || '',
|
||||
OpenAt: values.openTime ? values.openTime.format('HH:mm') : '',
|
||||
CloseAt: values.closeTime ? values.closeTime.format('HH:mm') : '',
|
||||
OpenAt: values.openAt ? values.openAt.format('HH:mm') : '',
|
||||
CloseAt: values.closeAt ? values.closeAt.format('HH:mm') : '',
|
||||
Status: '1',
|
||||
ProvideServices: values.services?.length ? values.services : null,
|
||||
QualificationAttachment: values.qualificationFiles?.map(f => f.url || f.response?.url) || null,
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
</x-search-bar>
|
||||
<a-row :gutter="8" :wrap="false">
|
||||
<a-col flex="auto">
|
||||
<a-card title="服务人员列表">
|
||||
<a-card title="回访记录列表">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<a-space>
|
||||
<!-- <a-button type="primary" @click="$refs.editDialogRef.handleCreate(record)">新建</a-button> -->
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
</a-collapse>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<a-row :gutter="gutter" style="margin-top: 16px;">
|
||||
<a-row :gutter="gutter" style="margin-top: 26px;">
|
||||
<a-col :span="24" style="text-align: right;">
|
||||
<a-space>
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
<a-row :gutter="8" :wrap="false" style="margin-top: 20px;">
|
||||
<a-col flex="auto">
|
||||
<a-card title="回访列表">
|
||||
<a-card title="待派单列表">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<a-space>
|
||||
<a-button type="primary">导入</a-button>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user