|
|
|
@ -27,16 +27,16 @@ |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button v-hasPermi="['im:chatPackage:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button v-hasPermi="['im:chatPackage:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" |
|
|
|
>修改</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
</el-col> --> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button v-hasPermi="['im:chatPackage:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" |
|
|
|
>删除</el-button |
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-col> --> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button v-hasPermi="['im:chatPackage:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button> |
|
|
|
</el-col> --> |
|
|
|
@ -45,7 +45,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="chatPackageList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<!-- <el-table-column type="selection" width="55" align="center" /> --> |
|
|
|
<!-- <el-table-column label="主键ID" align="center" prop="id" v-if="true" /> --> |
|
|
|
<el-table-column label="套餐名称" align="center" prop="packageName" /> |
|
|
|
<el-table-column label="客服数量" align="center" prop="customerServiceNumber" /> |
|
|
|
@ -62,6 +62,15 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-tooltip content="套餐分配" placement="top"> |
|
|
|
<el-button |
|
|
|
v-hasPermi="['im:chatPackage:allocatePackages']" |
|
|
|
link |
|
|
|
type="primary" |
|
|
|
icon="Plus" |
|
|
|
@click="handleAllocatePackages(scope.row)" |
|
|
|
></el-button> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip content="修改" placement="top"> |
|
|
|
<el-button v-hasPermi="['im:chatPackage:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button> |
|
|
|
</el-tooltip> |
|
|
|
@ -109,12 +118,15 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<AllocatePackagesDialog ref="allocatePackagesDialogRef" :package-id="form.id" @success="getList" @close="handleAllocatePackagesClose" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup name="ChatPackage" lang="ts"> |
|
|
|
import { listChatPackage, getChatPackage, delChatPackage, addChatPackage, updateChatPackage } from '@/api/im/chatPackage'; |
|
|
|
import { ChatPackageVO, ChatPackageQuery, ChatPackageForm } from '@/api/im/chatPackage/types'; |
|
|
|
import AllocatePackagesDialog from './component/allocatePackagesDialog.vue'; |
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
|
|
|
const { commom_status } = toRefs<any>(proxy?.useDict('commom_status')); |
|
|
|
@ -130,6 +142,7 @@ const total = ref(0); |
|
|
|
|
|
|
|
const queryFormRef = ref<ElFormInstance>(); |
|
|
|
const chatPackageFormRef = ref<ElFormInstance>(); |
|
|
|
const allocatePackagesDialogRef = ref(); |
|
|
|
|
|
|
|
const dialog = reactive<DialogOption>({ |
|
|
|
visible: false, |
|
|
|
@ -263,6 +276,27 @@ const handleExport = () => { |
|
|
|
); |
|
|
|
}; |
|
|
|
|
|
|
|
/** 分配套餐 */ |
|
|
|
const handleAllocatePackages = async (row?: ChatPackageVO) => { |
|
|
|
const packageId = row?.id || ids.value[0]; |
|
|
|
if (!packageId) { |
|
|
|
proxy?.$modal.msgError('请先选择要分配的套餐'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 设置当前选中的套餐ID |
|
|
|
form.value.id = packageId; |
|
|
|
|
|
|
|
// 打开分配对话框 |
|
|
|
allocatePackagesDialogRef.value.openDialog(); |
|
|
|
}; |
|
|
|
|
|
|
|
/** 分配套餐对话框关闭 */ |
|
|
|
const handleAllocatePackagesClose = () => { |
|
|
|
// 重置选中的ID |
|
|
|
ids.value = []; |
|
|
|
}; |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
|