Bladeren bron

reactor:对接随手拍邀请码;

zhangchong 3 maanden geleden
bovenliggende
commit
78b2e4a03b

+ 11 - 0
src/api/snapshot/config.ts

@@ -154,6 +154,17 @@ export const getSmsDetail = (id: string) => {
 		method: 'get',
 	});
 }
+/**
+ * @description 删除短信模板
+ * @param {object} data
+ */
+export const delSmsTemplate = (data: object) => {
+	return request({
+		url: '/api/v1/Industry/sms_template',
+		method: 'delete',
+		data,
+	});
+}
 /**
  * @description 更新短信模板
  * @param {object} data

+ 54 - 4
src/views/snapshot/config/sms/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div class="snapshot-config-sms-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<vxe-grid v-bind="gridOptions" ref="gridRef">
+			<vxe-grid v-bind="gridOptions" ref="gridRef" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
 				<template #form>
 					<el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent :disabled="gridOptions.loading">
 						<el-form-item label="行业名称" prop="IndustryName">
@@ -21,6 +21,9 @@
 				</template>
 				<template #toolbar_buttons>
 					<el-button type="primary" @click="onAdd" v-auth="'snapshot:config:sms:add'"> <SvgIcon name="ele-Plus" class="mr5" />新增短信 </el-button>
+					<el-button type="danger" @click="onDelete" v-auth="'snapshot:config:sms:delete'" :disabled="isChecked" :loading="state.loading"
+						><SvgIcon name="ele-Delete" class="mr5" />删除<span v-if="checkTable.length">({{ checkTable.length }})</span>
+					</el-button>
 				</template>
 				<template #action="{ row }">
 					<el-button link type="primary" @click="onEdit(row)" v-auth="'snapshot:config:sms:edit'" title="编辑"> 编辑 </el-button>
@@ -44,9 +47,9 @@
 </template>
 
 <script lang="tsx" setup name="snapshotConfigSms">
-import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
-import { FormInstance } from 'element-plus';
-import { getSmsList } from '@/api/snapshot/config';
+import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
+import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
+import { delSmsTemplate, delVolunteer, getSmsList } from '@/api/snapshot/config';
 
 // 引入组件
 const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
@@ -95,6 +98,7 @@ const gridOptions = reactive<any>({
 	rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
 	height: 'auto',
 	columns: [
+		{ type: 'checkbox', width: 50, align: 'center' },
 		{
 			field: 'content',
 			title: '短信内容',
@@ -173,6 +177,52 @@ const smsEditRef = ref<RefType>();
 const onEdit = (row: any) => {
 	smsEditRef.value.openDialog(row.id);
 };
+const checkTable = ref<EmptyArrayType>([]);
+const gridRef = ref<RefType>();
+const selectAllChangeEvent = ({ checked }) => {
+	if (gridRef.value) {
+		const records = gridRef.value.getCheckboxRecords();
+		checkTable.value = records;
+		console.log(checked ? '所有勾选事件' : '所有取消事件', records);
+	}
+};
+
+const selectChangeEvent = ({ checked }) => {
+	if (gridRef.value) {
+		const records = gridRef.value.getCheckboxRecords();
+		checkTable.value = records;
+		console.log(checked ? '勾选事件' : '取消事件', records);
+	}
+};
+const isChecked = computed(() => {
+	return !Boolean(checkTable.value.length);
+});
+// 删除
+const onDelete = () => {
+	const ids = checkTable.value.map((item: any) => item.id);
+	ElMessageBox.confirm(`您确定删除选选中的短信审批模板吗?,是否继续?`, '提示', {
+		confirmButtonText: '确认',
+		cancelButtonText: '取消',
+		type: 'warning',
+		draggable: true,
+		cancelButtonClass: 'default-button',
+		autofocus: false,
+	})
+		.then(() => {
+			state.loading = true;
+			delSmsTemplate(ids)
+				.then(() => {
+					ElMessage.success('删除成功');
+					queryList();
+				})
+				.catch(() => {
+					state.loading = false;
+				});
+		})
+		.catch(() => {
+			state.loading = false;
+		});
+};
 // 页面加载时
 onMounted(() => {
 	queryList();

+ 1 - 0
src/views/snapshot/inviteCode/statistics/components/detail.vue

@@ -18,6 +18,7 @@
 								:default-time="defaultTimeStartEnd"
 								:clearable="false"
 							/>
+						</el-form-item>
 						<el-form-item label="姓名" prop="Name">
 							<el-input v-model="state.queryParams.Name" placeholder="请填写姓名" clearable @keyup.enter="handleQuery" class="keyword-input" />
 						</el-form-item>

+ 15 - 28
src/views/snapshot/inviteCode/statistics/index.vue

@@ -13,15 +13,6 @@
 						</el-form-item>
 					</el-form>
 				</template>
-				<template #pager>
-					<pagination
-						@pagination="queryList"
-						:total="state.total"
-						v-model:current-page="state.queryParams.PageIndex"
-						v-model:page-size="state.queryParams.PageSize"
-						:disabled="state.loading"
-					/>
-				</template>
 			</vxe-grid>
 		</div>
 		<!--  新增用户  -->
@@ -41,7 +32,6 @@ import { useRouter } from 'vue-router';
 import { getInviteCodeStatistics } from '@/api/snapshot/inviteCode';
 
 // 引入组件
-const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 const UserAdd = defineAsyncComponent(() => import('@/views/snapshot/config/areaUser/components/User-add.vue')); // 新增用户
 const UserEdit = defineAsyncComponent(() => import('@/views/snapshot/config/areaUser/components/User-edit.vue')); // 编辑用户
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
@@ -51,8 +41,6 @@ const state = reactive<any>({
 	loading: false,
 	queryParams: {
 		// 查询参数
-		PageIndex: 1,
-		PageSize: 20,
 		crTime: defaultDate, //
 		StartTime: null,
 		EndTime: null,
@@ -94,15 +82,15 @@ const gridOptions = reactive<any>({
 		{
 			field: 'count',
 			title: '邀请总量',
-			slots:{
-				default (scope:any) {
+			slots: {
+				default({ row }) {
 					return (
-						<el-button type="primary" onClick={() => linkDetail(scope)} link>
-							{scope.row.count}
+						<el-button type="primary" onClick={() => linkDetail(row)} link>
+							{row.count}
 						</el-button>
-					)
-				}
-			}
+					);
+				},
+			},
 		},
 	],
 	data: [],
@@ -125,8 +113,7 @@ const queryList = () => {
 	getInviteCodeStatistics(requestParams.value)
 		.then((res) => {
 			state.loading = false;
-			gridOptions.data = res.result.items ?? [];
-			state.total = res.result.total ?? 0;
+			gridOptions.data = res.result ?? [];
 			gridOptions.loading = false;
 		})
 		.finally(() => {
@@ -142,16 +129,16 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 };
 // 查看详情
 const router = useRouter();
-const linkDetail = (row:any)=>{
+const linkDetail = (row: any) => {
 	router.push({
-		path:'/snapshot/inviteCode/detailStatistics',
-		query:{
-			OrgId :row.id,
+		path: '/snapshot/inviteCode/detailStatistics',
+		query: {
+			OrgId: row.id,
 			StartTime: state.queryParams.crTime[0],
 			EndTime: state.queryParams.crTime[1],
-		}
-	})
-}
+		},
+	});
+};
 // 页面加载时
 onMounted(() => {
 	queryList();

+ 8 - 0
src/views/statistics/department/delay.vue

@@ -82,6 +82,14 @@
 							</el-button>
 						</template>
 					</vxe-column>
+					<vxe-column field="withdrawTotal" title="取消延期次数" sortable>
+						<template #default="{row}">
+							{{ row.withdrawTotal  }}
+<!--							<el-button type="primary" link @click="linkDetail(row, '4')">
+								{{ row.withdrawTotal  }}
+							</el-button>-->
+						</template>
+					</vxe-column>
 				</vxe-table>
 			</div>
 		</div>