Explorar el Código

reactor:综合查询新增总条数;

zhangchong hace 7 meses
padre
commit
701277dde8

+ 11 - 0
src/api/business/order.ts

@@ -36,6 +36,17 @@ export const orderListFixed = (params: any) => {
 		params,
 	});
 };
+/**
+ * @description 查询工单列表总数
+ * @param {any} params
+ */
+export const orderListCount = (params: any) => {
+	return request({
+		url: `/api/v1/Order/count`,
+		method: 'get',
+		params,
+	});
+};
 /**
  * @description 历史工单
  * @param {object} params

+ 17 - 3
src/views/business/order/index.vue

@@ -215,8 +215,9 @@
 						<order-detail :order="row" @updateList="queryList(true)" />
 					</template>
 				</ProTable>
-				<div class="flex-end mt20">
+				<div class="flex-end mt20" style="align-items: center">
 					<!--					<el-button class="default-button" @click="onChangeTotal">展示总数</el-button>-->
+					<span v-loading="totalLoading" class="mr10">共 {{ totalCount }} 条</span>
 					<el-pagination
 						layout="prev, pager, next"
 						:total="state.total"
@@ -414,7 +415,7 @@ import type { FormInstance } from 'element-plus';
 import { ElMessage, ElMessageBox } from 'element-plus';
 import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
 import { formatDate } from '@/utils/formatTime';
-import { exportJbOrder, exportOrder, listBaseData, orderList, orderListFixed } from '@/api/business/order';
+import { exportJbOrder, exportOrder, listBaseData, orderList, orderListCount, orderListFixed } from '@/api/business/order';
 import { addObserve } from '@/api/query/observe';
 import { addEnd } from '@/api/query/end';
 import { treeArea } from '@/api/auxiliary/area';
@@ -431,7 +432,7 @@ const OrderReturn = defineAsyncComponent(() => import('@/views/business/return/c
 const state = reactive<any>({
 	queryParams: {
 		PageIndex: 1, // 当前页
-		PageSize: 20, // 每页条数
+		PageSize: 50, // 每页条数
 		// 查询条件
 		No: null, // 工单编码
 		ProvinceNo: null, // 省工单编码
@@ -625,6 +626,8 @@ const handleCurrentChange = (val: number) => {
 	}
 };
 const requestParams = ref<EmptyObjectType>({});
+const totalCount = ref(0);
+const totalLoading = ref(false);
 const queryList = (isQuery: boolean = false) => {
 	if (showTotal.value) {
 		requestParams.value = Other.deepClone(state.queryParams);
@@ -662,6 +665,7 @@ const queryList = (isQuery: boolean = false) => {
 		requestParams.value.QueryIndex = queryIndex.value; // 数据批次
 		requestParams.value.ContentRetrieval = state.ruleForm.content;
 		state.loading = true;
+		totalLoading.value = true;
 		orderListFixed(requestParams.value)
 			.then((response: any) => {
 				if (isQuery) {
@@ -678,6 +682,16 @@ const queryList = (isQuery: boolean = false) => {
 				}
 				state.loading = false;
 			})
+			.then(() => { // 查询总数
+				orderListCount(requestParams.value)
+					.then((count) => {
+						totalCount.value = count.result;
+						totalLoading.value = false;
+					})
+					.catch(() => {
+						totalLoading.value = false;
+					});
+			})
 			.catch(() => {
 				state.loading = false;
 			});

+ 5 - 2
src/views/business/visit/index.vue

@@ -154,7 +154,7 @@
 </template>
 
 <script setup lang="tsx" name="businessVisit">
-import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
+import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { formatDate } from '@/utils/formatTime';
 import { visitList, visitSearchBaseData } from '@/api/business/visit';
@@ -187,6 +187,9 @@ const fastSearchChange = (val: string) => {
 };
 const storesThemeConfig = useThemeConfig();
 const { themeConfig } = storeToRefs(storesThemeConfig);
+const operationWidth = computed(()=>{
+	return ['ZiGong'].includes(themeConfig.value.appScope) ? 190 : 90;
+})
 // 表格配置项
 const columns = ref<any[]>([
 	{ prop: 'order.no', label: '工单编码', minWidth: 140 },
@@ -245,7 +248,7 @@ const columns = ref<any[]>([
 	{ prop: 'order.counterSignTypeText', label: '是否会签', minWidth: 90 },
 	// { prop: 'voicePj', label: '语音评价', width: 150 },
 	{ prop: 'hwyPj', label: '话务员满意度', minWidth: 120 },
-	{ prop: 'operation', label: '操作', fixed: 'right', width: 190, align: 'center' },
+	{ prop: 'operation', label: '操作', fixed: 'right', width: operationWidth, align: 'center' },
 ]);
 const state = reactive<any>({
 	queryParams: {