|
|
@@ -71,7 +71,28 @@ onBeforeMount(async () => {
|
|
|
const activeName = ref('pendingReview')
|
|
|
const pendingReviewlength = ref(0);
|
|
|
const reviewRejectedlength = ref(0);
|
|
|
-const tableData = ref([]);
|
|
|
+// 两个选项卡各自的数据和分页
|
|
|
+const tableDataPending = ref([]);//待审核
|
|
|
+const tableDataRejected = ref([]);//审核不通过
|
|
|
+const pageInfoPending = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ sizes: [10, 20, 30, 40, 50],
|
|
|
+ total: 0,
|
|
|
+});
|
|
|
+const pageInfoRejected = ref({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ sizes: [10, 20, 30, 40, 50],
|
|
|
+ total: 0,
|
|
|
+});
|
|
|
+// 当前激活选项卡的数据和分页
|
|
|
+const tableData = computed(() => {
|
|
|
+ return activeName.value === 'pendingReview' ? tableDataPending.value : tableDataRejected.value;
|
|
|
+});
|
|
|
+const pageInfo = computed(() => {
|
|
|
+ return activeName.value === 'pendingReview' ? pageInfoPending.value : pageInfoRejected.value;
|
|
|
+});
|
|
|
const sysUpAndDownList = ref<string[]>([])//选中id
|
|
|
const insurance_type = ref();
|
|
|
const valid_status = ref();
|
|
|
@@ -79,12 +100,7 @@ const audit_status = ref();
|
|
|
const is_enable = ref();
|
|
|
const route = useRoute();
|
|
|
const id = ref(route.query.id as string);//id参数
|
|
|
-const pageInfo = ref({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 20,
|
|
|
- sizes: [10, 20, 30, 40, 50],
|
|
|
- total: 100,
|
|
|
-});
|
|
|
+
|
|
|
const formInline = reactive({
|
|
|
agreement: '',//协议信息
|
|
|
productId: "",//归属
|
|
|
@@ -134,15 +150,18 @@ const fields = ref([
|
|
|
|
|
|
//费用数据查询
|
|
|
function findpage(status: any) {
|
|
|
- api.agreementApi.CostExternalFeePageList({ pages: pageInfo.value.pageNum, size: pageInfo.value.pageSize, ...formInline, auditStatus: status }).then((res: any) => {
|
|
|
+ // 根据状态使用对应的分页数据
|
|
|
+ let currentPageInfo = status === 0 ? pageInfoPending.value : pageInfoRejected.value;
|
|
|
+ api.agreementApi.CostExternalFeePageList({ pages: currentPageInfo.pageNum, size: currentPageInfo.pageSize, ...formInline, auditStatus: status }).then((res: any) => {
|
|
|
if (res.code == '200') {
|
|
|
- tableData.value = res.data.records;
|
|
|
- pageInfo.value.pageNum = res.data.current;
|
|
|
- pageInfo.value.pageSize = res.data.size;
|
|
|
- pageInfo.value.total = res.data.total;
|
|
|
- if (res.data.records[0]?.auditStatus == '0') {
|
|
|
+ currentPageInfo.pageNum = res.data.current;
|
|
|
+ currentPageInfo.pageSize = res.data.size;
|
|
|
+ currentPageInfo.total = res.data.total;
|
|
|
+ if (status == 0) {
|
|
|
+ tableDataPending.value = res.data.records;
|
|
|
pendingReviewlength.value = res.data.total;
|
|
|
} else {
|
|
|
+ tableDataRejected.value = res.data.records;
|
|
|
reviewRejectedlength.value = res.data.total;
|
|
|
}
|
|
|
} else {
|
|
|
@@ -234,14 +253,16 @@ const columns = [
|
|
|
];
|
|
|
//分页事件
|
|
|
function getList(item: PageInfo) {
|
|
|
- pageInfo.value.pageNum = item.pageNum;
|
|
|
- pageInfo.value.pageSize = item.pageSize;
|
|
|
+ // 根据当前选项卡更新对应的分页数据
|
|
|
if (activeName.value == 'pendingReview') {
|
|
|
+ pageInfoPending.value.pageNum = item.pageNum;
|
|
|
+ pageInfoPending.value.pageSize = item.pageSize;
|
|
|
findpage(0);
|
|
|
} else {
|
|
|
+ pageInfoRejected.value.pageNum = item.pageNum;
|
|
|
+ pageInfoRejected.value.pageSize = item.pageSize;
|
|
|
findpage(2);
|
|
|
}
|
|
|
-
|
|
|
};
|
|
|
// 费用编辑
|
|
|
const ruleFeeEditVisible = ref(false);
|
|
|
@@ -331,6 +352,7 @@ const ExternalauditSuccess = async (list: string[], automatic?: boolean) => {
|
|
|
await api.agreementApi.ExternalauditSuccess({ ids: list, automatic: automatic }).then((res: any) => {
|
|
|
if (res.code == '200') {
|
|
|
findpage(0);
|
|
|
+ findpage(2);
|
|
|
ElMessage({
|
|
|
type: 'success',
|
|
|
message: res.msg,
|
|
|
@@ -338,7 +360,7 @@ const ExternalauditSuccess = async (list: string[], automatic?: boolean) => {
|
|
|
})
|
|
|
ruleFeeEditVisible.value = false;
|
|
|
if (res.data) {
|
|
|
- let info: any = tableData.value.find((val: any) => val.id == res.data);
|
|
|
+ let info: any = tableDataPending.value.find((val: any) => val.id == res.data);
|
|
|
if (info) {
|
|
|
agreemenUpdate(info.id)
|
|
|
}
|
|
|
@@ -350,6 +372,7 @@ const ExternalauditFailed = async (list: string[], value: string, automatic?: bo
|
|
|
await api.agreementApi.ExternalauditFailed({ ids: list, reason: value, automatic: automatic }).then((res: any) => {
|
|
|
if (res.code == '200') {
|
|
|
findpage(0);
|
|
|
+ findpage(2);
|
|
|
ElMessage({
|
|
|
type: 'success',
|
|
|
message: res.msg,
|
|
|
@@ -357,7 +380,7 @@ const ExternalauditFailed = async (list: string[], value: string, automatic?: bo
|
|
|
})
|
|
|
ruleFeeEditVisible.value = false;
|
|
|
if (res.data) {
|
|
|
- let info: any = tableData.value.find((val: any) => val.id == res.data);
|
|
|
+ let info: any = tableDataPending.value.find((val: any) => val.id == res.data);
|
|
|
if (info) {
|
|
|
agreemenUpdate(info.id)
|
|
|
}
|
|
|
@@ -375,7 +398,11 @@ const resetForm = () => {
|
|
|
formInline.validState = "";
|
|
|
formInline.effectiveTime = [];
|
|
|
formInline.failureTime = [];
|
|
|
- findpage(0);
|
|
|
+ if (activeName.value == 'pendingReview') {
|
|
|
+ findpage(0);
|
|
|
+ } else {
|
|
|
+ findpage(2);
|
|
|
+ }
|
|
|
}
|
|
|
// 批量编辑
|
|
|
const handleClick = (pane: any) => {
|
|
|
@@ -407,4 +434,4 @@ const handleClick = (pane: any) => {
|
|
|
.el-inputs {
|
|
|
width: 100% !important;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|