Преглед изворни кода

reactor:对接随手拍网格员红包发放记录;

zhangchong пре 3 месеци
родитељ
комит
72428918cb
2 измењених фајлова са 51 додато и 56 уклоњено
  1. 11 0
      src/api/snapshot/reSend.ts
  2. 40 56
      src/views/snapshot/reSend/grid/index.vue

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

@@ -24,4 +24,15 @@ export const citizenRedEnvelopeApproval = (data: object) => {
 		method: 'put',
 		data,
 	});
+};
+/**
+ * @description 获取网格员红包发放列表
+ * @param {object} params
+ */
+export const getGridRedEnvelopeApprovalList = (params?: object) => {
+	return request({
+		url: '/api/v1/RedPack/record/guider',
+		method: 'get',
+		params,
+	});
 };

+ 40 - 56
src/views/snapshot/reSend/grid/index.vue

@@ -1,29 +1,23 @@
 <template>
 	<div class="snapshot-re-send-grid-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<vxe-grid v-bind="gridOptions" ref="gridRef" @checkbox-all="selectAllChangeEvent" @checkbox-change="selectChangeEvent">
+			<vxe-grid v-bind="gridOptions" ref="gridRef">
 				<template #form>
 					<el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent :disabled="gridOptions.loading">
-						<el-form-item label="发送状态" prop="isPass">
-							<el-radio-group v-model="state.queryParams.isPass">
-								<el-radio value="0">发送成功</el-radio>
-								<el-radio value="1">发送失败</el-radio>
-								<el-radio value="2">婉拒</el-radio>
-								<el-radio value="3">未发送</el-radio>
+						<el-form-item label="发送状态" prop="Status">
+							<el-radio-group v-model="state.queryParams.Status" @change="handleQuery">
+								<el-radio :value="0">发送成功</el-radio>
+								<el-radio :value="1">发送失败</el-radio>
+								<el-radio :value="3">婉拒</el-radio>
+								<el-radio :value="2">未发送</el-radio>
 							</el-radio-group>
 						</el-form-item>
-						<el-form-item label="工单编码" prop="CaseName">
-							<el-input
-								v-model="state.queryParams.CaseName"
-								placeholder="请填写工单编码"
-								clearable
-								@keyup.enter="handleQuery"
-								class="keyword-input"
-							/>
+						<el-form-item label="工单编码" prop="No">
+							<el-input v-model="state.queryParams.No" placeholder="请填写工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
 						</el-form-item>
-						<el-form-item label="手机号" prop="IndustryName">
+						<el-form-item label="手机号" prop="PhoneNumber">
 							<el-input
-								v-model="state.queryParams.IndustryName"
+								v-model="state.queryParams.PhoneNumber"
 								placeholder="请填写手机号"
 								clearable
 								@keyup.enter="handleQuery"
@@ -37,7 +31,7 @@
 					</el-form>
 				</template>
 				<template #order_detail="{ row }">
-					<order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
+					<order-detail :order="{ id: row.orderId }" @updateList="queryList">{{ row.no }}</order-detail>
 				</template>
 				<template #pager>
 					<pagination
@@ -77,10 +71,11 @@
 </template>
 
 <script lang="tsx" setup name="snapshotReSendGrid">
-import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
+import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
-import { getClueList } from '@/api/snapshot/config';
 import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
+import Other from '@/utils/other';
+import { getGridRedEnvelopeApprovalList } from '@/api/snapshot/reSend';
 
 // 引入组件
 const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
@@ -93,9 +88,13 @@ const state = reactive<any>({
 		// 查询参数
 		PageIndex: 1,
 		PageSize: 20,
-		CaseName: null, // 线索名称
+		No: null, // 工单编码
+		PhoneNumber: null, // 手机号
 		IndustryName: null, // 行业类型
 		zjTime: [],
+		BeginCreationTime: null,
+		EndCreationTime: null,
+		Status: 0,
 	},
 	total: 0, // 总条数
 });
@@ -128,38 +127,42 @@ const gridOptions = reactive<any>({
 	height: 'auto',
 	columns: [
 		{
-			field: 'name',
+			field: 'no',
 			title: '工单编码',
 			slots: { default: 'order_detail' },
 		},
 		{
-			field: 'citizenReadPackAmountTxt',
+			field: 'creationTime',
 			title: '增加时间',
-			// formatter: 'formatDate',
+			formatter: 'formatDate',
 		},
 		{
-			field: 'guiderReadPackAmountTxt',
+			field: 'phoneNumber',
 			title: '手机号',
 		},
 		{
-			field: 'displayOrder',
+			field: 'name',
+			title: '姓名',
+		},
+		{
+			field: 'amount',
 			title: '金额',
 		},
 		{
-			field: 'citizenReadPackAmountTxt',
+			field: 'receiveTime',
 			title: '发放时间',
-			// formatter: 'formatDate',
+			formatter: 'formatDate',
 		},
 		{
-			field: 'citizenReadPackAmountTxt',
+			field: 'distributionStateTxt',
 			title: '状态',
 		},
 		{
-			field: 'citizenReadPackAmountTxt',
+			field: 'u',
 			title: '领取状态',
 		},
 		{
-			field: 'displayOrder',
+			field: 'remark',
 			title: '备注',
 			minWidth: 200,
 		},
@@ -172,10 +175,15 @@ const handleQuery = () => {
 	queryList();
 };
 // 获取参数列表
+const requestParams = ref<EmptyObjectType>({});
 const queryList = () => {
 	state.loading = true;
 	gridOptions.loading = true;
-	getClueList(state.queryParams)
+	requestParams.value = Other.deepClone(state.queryParams);
+	requestParams.value.BeginCreationTime = state.queryParams.zjTime === null ? null : state.queryParams.zjTime[0]; // 增加时间
+	requestParams.value.EndCreationTime = state.queryParams.zjTime === null ? null : state.queryParams.zjTime[1];
+	Reflect.deleteProperty(requestParams.value, 'zjTime'); // 删除无用的参数
+	getGridRedEnvelopeApprovalList(requestParams.value)
 		.then((res) => {
 			state.loading = false;
 			gridOptions.data = res.result.items ?? [];
@@ -197,30 +205,6 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 	ruleFormRef.value?.resetFields();
 	queryList();
 };
-
-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 onSend = () => {};
 // 页面加载时
 onMounted(() => {
 	queryList();