|
@@ -0,0 +1,640 @@
|
|
|
+<template>
|
|
|
+ <!-- ETA试用列表+审批列表 -->
|
|
|
+ <div class="eta-trial-list">
|
|
|
+ <div class="table-select">
|
|
|
+ <div class="btn-list">
|
|
|
+ <template v-if="false">
|
|
|
+ <!-- !Role.includes('admin') -->
|
|
|
+ <!-- 管理员-ETA试用列表 -->
|
|
|
+ <template v-if="route.path === '/etaTrialList'">
|
|
|
+ <t-button type="primary" @click="changePath('/etaApprovalList')">审批列表</t-button>
|
|
|
+ <div class="approval-hint" v-if="approvalNum">
|
|
|
+ ·{{ approvalNum }}条申请记录待审批
|
|
|
+ </div>
|
|
|
+ <t-button type="primary" @click="toQuestionnaireSurvey" style="margin-left: 30px;">问卷调研</t-button>
|
|
|
+ </template>
|
|
|
+ <!-- 管理员-审批列表 -->
|
|
|
+ <template v-if="route.path === '/etaApprovalList'">
|
|
|
+ <t-select v-model="approvalState" placeholder="请选择" @change="selectHandle">
|
|
|
+ <t-option
|
|
|
+ v-for="item in approvalStateArr"
|
|
|
+ :key="item.key"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.key"
|
|
|
+ ></t-option>
|
|
|
+ </t-select>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <!-- 非管理员-ETA试用列表 -->
|
|
|
+ <template v-if="route.path === '/etaTrialList'">
|
|
|
+ <t-button type="primary" @click="changePath('/etaAddApproval')">新增申请</t-button>
|
|
|
+ <t-button type="primary" plain @click="changePath('/etaApprovalList')" style="margin-left: 30px;">客户管理</t-button>
|
|
|
+ <t-button type="primary" @click="toQuestionnaireSurvey" style="margin-left: 30px;">问卷调研</t-button>
|
|
|
+ <t-checkbox v-model="onlyMine" @change="onlyMineChange" style="margin-left: 30px;">我申请的</t-checkbox>
|
|
|
+ </template>
|
|
|
+ <!-- 非管理员-我的审批+账号列表 -->
|
|
|
+ <template v-if="route.path === '/etaApprovalList'">
|
|
|
+ <div class="tips">*账号用于登录ETA试用平台:https://exptest.hzinsights.com/</div>
|
|
|
+ <div class="right-header">
|
|
|
+ <span>已选{{ selectedTotal }}</span>
|
|
|
+ <t-checkbox :indeterminate="isIndeterminate" v-model="isCheckAll" @change="listCheckAllChange" style="margin-left: 40px;">列表全选</t-checkbox>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div class="search-wrap">
|
|
|
+ <template v-if="route.path === '/etaApprovalList'">
|
|
|
+ <t-button type="primary" @click="batchMove">批量移动</t-button>
|
|
|
+ <t-button type="primary" @click="batchOperate">一键启用</t-button>
|
|
|
+ </template>
|
|
|
+ <t-input
|
|
|
+ v-model="searchText"
|
|
|
+ placeholder="姓名/公司名称"
|
|
|
+ @input="searchHandle"
|
|
|
+ style="width: 400px; margin-left: 20px;"
|
|
|
+ >
|
|
|
+ <template #prefixIcon><SearchIcon /></template>
|
|
|
+ </t-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="table-wrap">
|
|
|
+ <t-table :data="tableData" @sort-change="sortChangeHandle" :columns="columnList" ref="dataRef" border v-loading="tableLoading" @select="selectHandles" @select-all="selectAllHandle" @selection-change="selectionChange">
|
|
|
+ <!-- 多选 -->
|
|
|
+ <!-- <t-table-column align="center" type="selection" width="55" v-if="route.path === '/etaApprovalList'">
|
|
|
+ </t-table-column> -->
|
|
|
+
|
|
|
+ <!-- <template #approveType="{ row }">
|
|
|
+ <span >
|
|
|
+ {{ row['approveType'] === 0 ? '申请账号' : '申请启用' }}
|
|
|
+ </span>
|
|
|
+ </template> -->
|
|
|
+ <template #Enabled="{ row }" >
|
|
|
+ <span :class="{'color-hint': row['Enabled'] === 0}">
|
|
|
+ {{ row['Enabled'] === 0 ? '禁用' : '启用' }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template #cellEmptyContent="{ row }">
|
|
|
+ <!-- 非管理员-账号列表的操作: 申请启用 -->
|
|
|
+ <div>
|
|
|
+ <t-button type="text" size="small" @click="Move(row)">移动</t-button>
|
|
|
+ <t-button type="text" size="small" v-if="row.Enabled === 0" @click="handleOperate('active', row)">申请启用</t-button>
|
|
|
+ </div>
|
|
|
+ <!-- 非管理员-我的审批操作: 撤回,重新申请,删除,驳回理由-->
|
|
|
+ <div v-if="!Role.includes('admin') && listType === 'all'">
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] === 0" @click="handleOperate('withdraw', row)">撤回</t-button>
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] >= 2" @click="handleOperate('apply', row)">重新申请</t-button>
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] === 3" @click="handleOperate('checkReplay', row)">驳回理由</t-button>
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] === 2" class="color-hint" @click="handleOperate('delete', row)">删除</t-button>
|
|
|
+ <!-- 已审批通过的:查看密码 -->
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] === 1" @click="handleOperate('showDetail', row)">账号密码</t-button>
|
|
|
+ </div>
|
|
|
+ <!-- 管理员-审批列表操作: 审批-->
|
|
|
+ <!-- <template v-if="Role.includes('admin')">
|
|
|
+ <t-button type="text" size="small" v-if="ApprovalStatus[row.ApprovalStatus] === 0" @click="handleOperate('approve', row)">审批</t-button>
|
|
|
+ </template> -->
|
|
|
+ </template>
|
|
|
+ </t-table>
|
|
|
+ <t-pagination
|
|
|
+ layout="total,prev,pager,next,jumper"
|
|
|
+ background
|
|
|
+ :current-page="currentPage"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :total="total"
|
|
|
+ style="text-align:right;margin-top:30px;"
|
|
|
+ ></t-pagination>
|
|
|
+ </div>
|
|
|
+ <!-- 申请账号审批/申请启用审批 弹窗 -->
|
|
|
+ <!-- <apply-approval-dialog
|
|
|
+ :isApplyApprovalDialogShow.sync="isApplyApprovalDialogShow"
|
|
|
+ :applyInfo="applyInfo"
|
|
|
+ @approved="getTableData"
|
|
|
+ ></apply-approval-dialog> -->
|
|
|
+ <!-- 申请启用 弹窗 -->
|
|
|
+ <!-- <add-apply-hint-dialog
|
|
|
+ :isAddApplyHintShow.sync="isAddApplyHintShow"
|
|
|
+ :applyInfo="applyInfo"
|
|
|
+ @applyActiveSuccess="getTableData"
|
|
|
+ @closeDialog="closeDialog"
|
|
|
+ ></add-apply-hint-dialog> -->
|
|
|
+ <!-- 移动弹窗 -->
|
|
|
+ <!-- <move
|
|
|
+ :isMoveShow.sync="isMoveShow"
|
|
|
+ :moveInfo="moveInfo"
|
|
|
+ @moveConfirm="moveConfirm"
|
|
|
+ @closeMove="closeMove"
|
|
|
+ ></move> -->
|
|
|
+ <!-- 查看账号密码弹窗 -->
|
|
|
+ <t-dialog
|
|
|
+ v-if="showDetailDialogShow"
|
|
|
+ :visible="showDetailDialogShow"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :title="`${applyInfo.applyData[0].UserName}——账号密码`"
|
|
|
+ width="889px"
|
|
|
+ draggable
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div class="apply-detail">
|
|
|
+ <p>公司名称:{{ applyInfo.applyData[0].CompanyName }}</p>
|
|
|
+ <p>账号:{{ applyInfo.applyData[0].Account }}</p>
|
|
|
+ <p>密码:{{ applyInfo.applyData[0].Password }}</p>
|
|
|
+ <div class="button">
|
|
|
+ <t-button type="primary" @click="showDetailDialogShow = false">知道了</t-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </t-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref, reactive, computed, watch, onMounted } from 'vue';
|
|
|
+// import { TButton, TSelect, TOption, TTable, TTableColumn, TPagination, TDialog } from 'tdesign-vue-next';
|
|
|
+import { SearchIcon } from 'tdesign-icons-vue-next';
|
|
|
+import { etaTrialColumn, adminApprovalList, approvedList, ApprovalStatus } from './config';
|
|
|
+import { etaTrialInterence } from '@/api/modules/crmApi.js';
|
|
|
+import { customInterence } from '@/api/api.js';
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
+const router=useRouter()
|
|
|
+const route=useRoute()
|
|
|
+// 响应式数据
|
|
|
+const currentPath = ref('');
|
|
|
+const approvalNum = ref(0);
|
|
|
+const searchText = ref('');
|
|
|
+const onlyMine = ref(false);
|
|
|
+const listType = ref('approved');
|
|
|
+const approvalState = ref();
|
|
|
+const approvalStateArr = reactive([
|
|
|
+ { key: 2, label: '待审批' },
|
|
|
+ { key: 3, label: '已审批' },
|
|
|
+ { key: 1, label: '全部' },
|
|
|
+]);
|
|
|
+// const ApprovalStatus = reactive(ApprovalStatus);
|
|
|
+const canEdit = ref(false);
|
|
|
+const tableData = ref([]);
|
|
|
+const columnList = ref([]);
|
|
|
+const tableLoading = ref(false);
|
|
|
+const sortKeys = reactive([
|
|
|
+ 'Expiration', 'ModifyTime', 'LastLoginTime', 'ActiveTime',
|
|
|
+ 'IndexNum', 'ChartNum', 'LoginNum', 'LastLoginDuration',
|
|
|
+]);
|
|
|
+const SortParam = ref('');
|
|
|
+const SortType = ref('');
|
|
|
+const applyInfo = reactive({});
|
|
|
+const currentPage = ref(1);
|
|
|
+const pageSize = ref(10);
|
|
|
+const total = ref(1);
|
|
|
+const isApplyApprovalDialogShow = ref(false);
|
|
|
+const isAddApplyHintShow = ref(false);
|
|
|
+const showDetailDialogShow = ref(false);
|
|
|
+const isIndeterminate = ref(false);
|
|
|
+const isCheckAll = ref(false);
|
|
|
+const isSelectAll = ref(false);
|
|
|
+const selectList = ref([]);
|
|
|
+const choiceIdList = ref([]);
|
|
|
+const tableDataIds = ref([]);
|
|
|
+const isMoveShow = ref(false);
|
|
|
+const moveInfo = reactive({
|
|
|
+ type: 1, // 1 移动 2 批量移动
|
|
|
+ salesArr: [], // 销售列表
|
|
|
+ selectArr: [], // 已选择的id
|
|
|
+});
|
|
|
+
|
|
|
+// 计算属性
|
|
|
+const Role = computed(() => localStorage.getItem('Role'));
|
|
|
+const selectedTotal = computed(() => {
|
|
|
+ if (isSelectAll.value) {
|
|
|
+ return total.value - selectList.value.length;
|
|
|
+ } else {
|
|
|
+ return selectList.value.length;
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
+// 监听器
|
|
|
+watch('route.path', (newVal) => {
|
|
|
+ currentPath.value = newVal;
|
|
|
+ currentPage.value = 1;
|
|
|
+ SortParam.value = '';
|
|
|
+ SortType.value = '';
|
|
|
+ approvalState.value = 2;
|
|
|
+ searchText.value = '';
|
|
|
+ getTableData();
|
|
|
+});
|
|
|
+watch('listType', (val) => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ SortParam.value = '';
|
|
|
+ SortType.value = '';
|
|
|
+ approvalState.value = 2;
|
|
|
+ searchText.value = '';
|
|
|
+ getTableData();
|
|
|
+});
|
|
|
+
|
|
|
+// 方法
|
|
|
+const getSalesArr = async () => {
|
|
|
+ const res = await customInterence.getSale();
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ moveInfo.salesArr = res.Data.List || [];
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getTableData = async (type) => {
|
|
|
+ tableLoading.value = true;
|
|
|
+ let interenceName = 'getETATrialList';
|
|
|
+ if (currentPath.value === '/etaTrialList') {
|
|
|
+ canEdit.value = false;
|
|
|
+ columnList.value = etaTrialColumn;
|
|
|
+ interenceName = 'getETATrialList';
|
|
|
+ } else if (currentPath.value === '/etaApprovalList') {
|
|
|
+ canEdit.value = true;
|
|
|
+ if (listType.value !== 'all') {
|
|
|
+ columnList.value = approvedList;
|
|
|
+ interenceName = 'getApprovalList';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ columnList.value = etaTrialColumn
|
|
|
+ console.log(etaTrialColumn);
|
|
|
+
|
|
|
+ const res = await etaTrialInterence[interenceName]({
|
|
|
+ PageSize: pageSize.value,
|
|
|
+ CurrentIndex: currentPage.value,
|
|
|
+ KeyWord: searchText.value,
|
|
|
+ SortParam: SortParam.value,
|
|
|
+ SortType: SortType.value,
|
|
|
+ ListParam: approvalState.value,
|
|
|
+ IsOnlyMe: onlyMine.value,
|
|
|
+ });
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ const { List, Paging, ApprovalNum } = res.Data;
|
|
|
+ tableData.value = List || [];
|
|
|
+ total.value = Paging.Totals;
|
|
|
+ approvalNum.value = ApprovalNum || 0;
|
|
|
+ tableLoading.value = false;
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
+ tableDataIds.value = tableData.value.map(it => it.EtaTrialId);
|
|
|
+ } else {
|
|
|
+ tableDataIds.value = [];
|
|
|
+ }
|
|
|
+ if (type === 'search') {
|
|
|
+ selectList.value = [];
|
|
|
+ listCheckAllChange(false);
|
|
|
+ } else {
|
|
|
+ adjustSelection();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const sortChangeHandle = ({ prop, order }) => {
|
|
|
+ SortParam.value = prop;
|
|
|
+ SortType.value = order === 'ascending' ? 'asc' : 'desc';
|
|
|
+ currentPage.value = 1;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const searchHandle = () => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const selectHandle = (change) => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ approvalState.value = change;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const onlyMineChange = () => {
|
|
|
+ currentPage.value = 1;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const changePath = (path) => {
|
|
|
+ if (currentPath.value === path) return;
|
|
|
+ currentPath.value = path;
|
|
|
+ router.push(path); // 确保 router 已被正确导入
|
|
|
+};
|
|
|
+
|
|
|
+const toQuestionnaireSurvey = () => {
|
|
|
+ router.push('/questionnaireSurvey'); // 确保 router 已被正确导入
|
|
|
+};
|
|
|
+
|
|
|
+const handleCurrentChange = (pageNo) => {
|
|
|
+ currentPage.value = pageNo;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const adjustSelection = () => {
|
|
|
+ if (!isSelectAll.value) {
|
|
|
+ tableData.value.forEach(it => {
|
|
|
+ if (selectList.value.includes(it.EtaTrialId)) {
|
|
|
+ // 假设这里有一个方法 toggleRowSelection 来切换行的选中状态
|
|
|
+ // toggleRowSelection(it, true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ tableData.value.forEach(it => {
|
|
|
+ if (!selectList.value.includes(it.EtaTrialId)) {
|
|
|
+ // toggleRowSelection(it, true);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const listCheckAllChange = (value) => {
|
|
|
+ selectList.value = [];
|
|
|
+ isSelectAll.value = value;
|
|
|
+ // 假设这里有一个方法来清除所有行的选中状态
|
|
|
+ // clearSelection();
|
|
|
+ if (value) {
|
|
|
+ // 假设这里有一个方法来选中所有行
|
|
|
+ // toggleAllSelection();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const selectionChange = (selection) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ const duplicateArr = Array.from(new Set(selectList.value));
|
|
|
+ if ((duplicateArr.length === total.value && !isSelectAll.value) || (duplicateArr.length === 0 && isSelectAll.value)) {
|
|
|
+ isCheckAll.value = true;
|
|
|
+ isIndeterminate.value = false;
|
|
|
+ } else if ((duplicateArr.length === 0 && !isSelectAll.value) || (duplicateArr.length === total.value && isSelectAll.value)) {
|
|
|
+ isCheckAll.value = false;
|
|
|
+ isIndeterminate.value = false;
|
|
|
+ } else {
|
|
|
+ isCheckAll.value = false;
|
|
|
+ isIndeterminate.value = true;
|
|
|
+ }
|
|
|
+ }, 1);
|
|
|
+};
|
|
|
+
|
|
|
+const selectHandles = (selection, row) => {
|
|
|
+ let check = false;
|
|
|
+ if (selection.some(it => it.EtaTrialId === row.EtaTrialId)) {
|
|
|
+ if (isSelectAll.value) {
|
|
|
+ check = false;
|
|
|
+ } else {
|
|
|
+ check = true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isSelectAll.value) {
|
|
|
+ check = true;
|
|
|
+ } else {
|
|
|
+ check = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (check) {
|
|
|
+ selectList.value.push(row.EtaTrialId);
|
|
|
+ } else {
|
|
|
+ selectList.value = selectList.value.filter(it => it !== row.EtaTrialId);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const selectAllHandle = (selection) => {
|
|
|
+ let check = false;
|
|
|
+ if (selection && selection.length > 0) {
|
|
|
+ if (isSelectAll.value) {
|
|
|
+ check = false;
|
|
|
+ } else {
|
|
|
+ check = true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isSelectAll.value) {
|
|
|
+ check = true;
|
|
|
+ } else {
|
|
|
+ check = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (check) {
|
|
|
+ selectList.value = [...selectList.value, ...tableDataIds.value];
|
|
|
+ } else {
|
|
|
+ selectList.value = selectList.value.filter(it => !tableDataIds.value.includes(it));
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const getApplyInfo = (type, data) => {
|
|
|
+ const temp = { applyType: 1, applyData: [] };
|
|
|
+ temp.applyType = data.ApplyMethod || 2;
|
|
|
+ if ((type === 'apply' || type === 'withdraw' || type === 'approve') && data.ApplyMethod === 2) {
|
|
|
+ temp.applyType = 0;
|
|
|
+ }
|
|
|
+ if (type === 'active') {
|
|
|
+ temp.applyType = 0;
|
|
|
+ }
|
|
|
+ temp.applyData = [data];
|
|
|
+ applyInfo = temp;
|
|
|
+};
|
|
|
+
|
|
|
+const handleOperate = async (type, data) => {
|
|
|
+ getApplyInfo(type, data);
|
|
|
+ if (type === 'approve') {
|
|
|
+ isApplyApprovalDialogShow.value = true;
|
|
|
+ } else if (type === 'active') {
|
|
|
+ isAddApplyHintShow.value = true;
|
|
|
+ } else if (type === 'apply') {
|
|
|
+ const { ApplyMethod } = data;
|
|
|
+ if (ApplyMethod === 1) {
|
|
|
+ sessionStorage.setItem('applyInfo', JSON.stringify(applyInfo));
|
|
|
+ router.push('/etaAddApproval'); // 确保 router 已被正确导入
|
|
|
+ } else {
|
|
|
+ isAddApplyHintShow.value = true;
|
|
|
+ }
|
|
|
+ } else if (type === 'withdraw') {
|
|
|
+ const res = await etaTrialInterence.withdrawApproval({ Mobile: data.Mobile });
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ const confirmResult = await confirm('', '撤回成功', {
|
|
|
+ confirmButtonText: '重新申请',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ cancelButtonClass: "btn-custom-cancel",
|
|
|
+ type: 'success',
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ if (confirmResult) {
|
|
|
+ const { ApplyMethod } = data;
|
|
|
+ if (ApplyMethod === 1) {
|
|
|
+ sessionStorage.setItem('applyInfo', JSON.stringify(applyInfo));
|
|
|
+ router.push('/etaAddApproval'); // 确保 router 已被正确导入
|
|
|
+ } else {
|
|
|
+ isAddApplyHintShow.value = true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ getTableData();
|
|
|
+ }
|
|
|
+ } else if (type === 'checkReplay') {
|
|
|
+ await confirm(data.ApprovalRemark || '', '驳回理由', {
|
|
|
+ confirmButtonText: '知道了',
|
|
|
+ showCancelButton: false,
|
|
|
+ });
|
|
|
+ } else if (type === 'delete') {
|
|
|
+ const confirmResult = await confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
+ confirmButtonText: '确认',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ });
|
|
|
+ if (confirmResult) {
|
|
|
+ const res = await etaTrialInterence.deleteApproval({ ApprovalId: data.ApprovalId });
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ getTableData();
|
|
|
+ message.success('删除成功'); // 确保 message 已被正确导入
|
|
|
+ }
|
|
|
+ } else if (type === 'showDetail') {
|
|
|
+ showDetailDialogShow.value = true;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const closeDialog = () => {
|
|
|
+ isAddApplyHintShow.value = false;
|
|
|
+ getTableData();
|
|
|
+};
|
|
|
+
|
|
|
+const moveConfirm = (data) => {
|
|
|
+ const { type, value, selectArr } = data;
|
|
|
+ const currentSellerId = parseInt(value[value.length - 1]);
|
|
|
+ const params = {
|
|
|
+ currentSellerId,
|
|
|
+ EtaTrialIdList: selectArr,
|
|
|
+ IsCheckAll: type === 1 ? false : isSelectAll.value,
|
|
|
+ CurrentSellerName: findElementByAdminId(moveInfo.salesArr, currentSellerId).RealName,
|
|
|
+ };
|
|
|
+ etaTrialInterence.accountTransfer(params).then(res => {
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ message.success('移动成功'); // 确保 message 已被正确导入
|
|
|
+ getTableData();
|
|
|
+ isMoveShow.value = false;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const findElementByAdminId = (arr, adminId) => {
|
|
|
+ adminId = adminId + '';
|
|
|
+ for (const element of arr) {
|
|
|
+ if (element.AdminId === adminId) {
|
|
|
+ return element;
|
|
|
+ }
|
|
|
+ if (element.ChildrenList && element.ChildrenList.length > 0) {
|
|
|
+ const found = findElementByAdminId(element.ChildrenList, adminId);
|
|
|
+ if (found) {
|
|
|
+ return found;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+};
|
|
|
+
|
|
|
+const closeMove = () => {
|
|
|
+ isMoveShow.value = false;
|
|
|
+};
|
|
|
+
|
|
|
+const Move = (row) => {
|
|
|
+ moveInfo.type = 1;
|
|
|
+ moveInfo.selectArr = [row.EtaTrialId];
|
|
|
+ isMoveShow.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const batchMove = () => {
|
|
|
+ if (selectList.value.length === 0) {
|
|
|
+ message.warning('请至少选择一个客户'); // 确保 message 已被正确导入
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ moveInfo.type = 2;
|
|
|
+ moveInfo.selectArr = selectList.value;
|
|
|
+ isMoveShow.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+const batchOperate = async () => {
|
|
|
+ if (getMobileList(tableData.value, selectList.value).length === 0) {
|
|
|
+ message.warning('请至少选择一个客户'); // 确保 message 已被正确导入
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res = await etaTrialInterence.applyEnable({
|
|
|
+ MobileList: getMobileList(tableData.value, selectList.value),
|
|
|
+ IsCheckAll: isSelectAll.value,
|
|
|
+ });
|
|
|
+ if (res.Ret !== 200) return;
|
|
|
+ getTableData();
|
|
|
+ message.success('启用成功'); // 确保 message 已被正确导入
|
|
|
+};
|
|
|
+
|
|
|
+const getMobileList = (array1, array2) => {
|
|
|
+ return array1.filter(element => array2.includes(element.EtaTrialId)).map(element => element.Mobile);
|
|
|
+};
|
|
|
+
|
|
|
+// 生命周期钩子
|
|
|
+onMounted(() => {
|
|
|
+ currentPath.value = route.path;
|
|
|
+ getTableData();
|
|
|
+ getSalesArr();
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style lang="scss">
|
|
|
+.btn-custom-cancel{
|
|
|
+ float: right;
|
|
|
+ margin-left: -100px;
|
|
|
+ margin-right: 110px;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style scoped lang="scss">
|
|
|
+.eta-trial-list{
|
|
|
+ padding:30px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 4px;
|
|
|
+ .table-select{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .btn-list{
|
|
|
+ .approval-hint{
|
|
|
+ margin-left: 15px;
|
|
|
+ border-radius: 4px;
|
|
|
+ padding:5px 12px;
|
|
|
+ background-color: #FEF0F0;
|
|
|
+ color: #F56C6C;
|
|
|
+ position: relative;
|
|
|
+ &::before{
|
|
|
+ content: '';
|
|
|
+ position:absolute;
|
|
|
+ width:0;
|
|
|
+ height:0;
|
|
|
+ left:-12px;
|
|
|
+ top:calc(50% - 6px);
|
|
|
+ border: 6px solid transparent;
|
|
|
+ border-right: 6px solid #FEF0F0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tips {
|
|
|
+ margin: 10px 25px;
|
|
|
+ font-family: Arial;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 400;
|
|
|
+ line-height: 17.25px;
|
|
|
+ text-align: center;
|
|
|
+ color: rgba(153, 153, 153, 1);
|
|
|
+ }
|
|
|
+ .right-header {
|
|
|
+ margin-top: 40px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .search-wrap{
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .table-wrap{
|
|
|
+ margin-top:30px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .color-hint{
|
|
|
+ color: red;
|
|
|
+ }
|
|
|
+ .apply-detail{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap:20px;
|
|
|
+ p{
|
|
|
+ font-size: 16px;
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
+ .button{
|
|
|
+ text-align: center;
|
|
|
+ padding-bottom: 25px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|