1、将确认驳回模块提取成公共组件
2、修复待办已办查询数据显示顺序问题
This commit is contained in:
parent
f372b341cc
commit
a367b946b9
@ -89,7 +89,9 @@ const currentTab = ref('A'); // 0: 待办, 1: 已办
|
|||||||
const fetchListData = async (tabIndex: string) => {
|
const fetchListData = async (tabIndex: string) => {
|
||||||
setParam({
|
setParam({
|
||||||
dbZt: tabIndex,
|
dbZt: tabIndex,
|
||||||
jsrId: getJs.id
|
jsrId: getJs.id,
|
||||||
|
sidx: "xxtstime",
|
||||||
|
sord: "desc",
|
||||||
});
|
});
|
||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
|
|||||||
117
src/pages/components/YwConfirm/index.vue
Normal file
117
src/pages/components/YwConfirm/index.vue
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<template>
|
||||||
|
<view class="white-bg-color py-5">
|
||||||
|
<view class="flex-row items-center pb-10 pt-5">
|
||||||
|
<u-button text="驳回" class="ml-15 mr-7" :plain="true" @click="showDlg" />
|
||||||
|
<u-button text="同意" class="mr-15 mr-7" type="primary" @click="submit" />
|
||||||
|
</view>
|
||||||
|
<!-- 驳回弹窗 -->
|
||||||
|
<u-popup :show="dlgFlag" mode="center" :closeOnClickOverlay="false" @close="closeDlg">
|
||||||
|
<view class="popup-content">
|
||||||
|
<view class="popup-header">
|
||||||
|
<view class="popup-title">驳回原因</view>
|
||||||
|
</view>
|
||||||
|
<view class="popup-body">
|
||||||
|
<u-input v-model="rejectReason" type="textarea" placeholder="请填写驳回原因" :autoHeight="true" maxlength="200" class="reject-reason-input" />
|
||||||
|
</view>
|
||||||
|
<view class="popup-actions flex-row justify-end mt-4">
|
||||||
|
<u-button class="mr-2" @click="closeDlg">取消</u-button>
|
||||||
|
<u-button type="primary" @click="handleReject">确定</u-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</u-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
// 接收外部传入属性并设置默认值
|
||||||
|
const props = withDefaults(defineProps<{
|
||||||
|
api: any, // 请求API
|
||||||
|
params: any, // 默认的请求参数
|
||||||
|
stausName?: string, // 默认的状态属性名
|
||||||
|
remarkName?: string, // 默认的审批说明属性名
|
||||||
|
approvedValue?: string, // 默认的同意时的状态值
|
||||||
|
rejectValue?: string, // 默认的拒绝时的状态值
|
||||||
|
approvedRemark?: string // 默认的同意说明文字
|
||||||
|
}>(), {
|
||||||
|
api: async (params: any) => {},
|
||||||
|
params: {},
|
||||||
|
stausName: 'spStatus',
|
||||||
|
remarkName: 'spRemark',
|
||||||
|
approvedValue: 'approved',
|
||||||
|
rejectValue: 'rejected',
|
||||||
|
approvedRemark: '同意'
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 定义一个上级传入的emit响应事件用于接收数据变更
|
||||||
|
const emit = defineEmits(['submit', 'reject'])
|
||||||
|
|
||||||
|
const dlgFlag = ref(false);
|
||||||
|
const rejectReason = ref("");
|
||||||
|
const showDlg = () => {
|
||||||
|
dlgFlag.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closeDlg = () => {
|
||||||
|
dlgFlag.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const submit = async () => {
|
||||||
|
const params = {
|
||||||
|
...props.params
|
||||||
|
};
|
||||||
|
params[props.stausName] = props.approvedValue;
|
||||||
|
params[props.remarkName] = "";
|
||||||
|
uni.showLoading({ title: "确认中..." });
|
||||||
|
await props.api(params);
|
||||||
|
uni.hideLoading();
|
||||||
|
closeDlg();
|
||||||
|
emit('submit');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 驳回处理
|
||||||
|
const handleReject = async () => {
|
||||||
|
if (!rejectReason.value.trim()) {
|
||||||
|
uni.showToast({ title: "请填写驳回意见", icon: "none" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
|
...props.params
|
||||||
|
};
|
||||||
|
params[props.stausName] = props.rejectValue;
|
||||||
|
params[props.remarkName] = rejectReason.value;
|
||||||
|
uni.showLoading({ title: "正在驳回..." });
|
||||||
|
await props.api(params);
|
||||||
|
uni.hideLoading();
|
||||||
|
closeDlg();
|
||||||
|
emit('reject');
|
||||||
|
};
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
showDlg,
|
||||||
|
closeDlg
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.popup-content {
|
||||||
|
.popup-header {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
border-bottom: 1px solid $u-border-color;
|
||||||
|
}
|
||||||
|
.popup-body {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
|
||||||
|
.reject-reason-input {
|
||||||
|
min-height: 160rpx;
|
||||||
|
min-width: 500rpx;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.popup-actions {
|
||||||
|
padding: 20rpx 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -36,35 +36,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="white-bg-color py-5">
|
<YwConfirm :api="jsQjDkQrApi" :params="spParams"
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
@summit="submit" @reject="handleReject" />
|
||||||
<u-button text="驳回" class="ml-15 mr-7" :plain="true" @click="showDlg" />
|
|
||||||
<u-button text="同意" class="mr-15 mr-7" type="primary" @click="submit" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 驳回弹窗 -->
|
|
||||||
<u-popup
|
|
||||||
:show="dlgFlag"
|
|
||||||
mode="center"
|
|
||||||
:closeOnClickOverlay="false"
|
|
||||||
@close="closeDlg"
|
|
||||||
>
|
|
||||||
<view class="popup-content">
|
|
||||||
<view class="popup-title">驳回原因</view>
|
|
||||||
<u-input
|
|
||||||
v-model="rejectReason"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请填写驳回原因"
|
|
||||||
:autoHeight="true"
|
|
||||||
maxlength="200"
|
|
||||||
/>
|
|
||||||
<view class="popup-actions flex-row justify-end mt-4">
|
|
||||||
<u-button class="mr-2" @click="closeDlg">取消</u-button>
|
|
||||||
<u-button type="primary" @click="handleReject">确定</u-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</BasicLayout>
|
</BasicLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -77,6 +51,7 @@ import { ref } from "vue";
|
|||||||
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
||||||
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
||||||
import LcglSpList from "@/components/LcglSpList/index.vue";
|
import LcglSpList from "@/components/LcglSpList/index.vue";
|
||||||
|
import YwConfirm from "@/pages/components/YwConfirm/index.vue";
|
||||||
import { QjPageUtils } from "@/utils/qjPageUtils";
|
import { QjPageUtils } from "@/utils/qjPageUtils";
|
||||||
|
|
||||||
const { getJs } = useUserStore();
|
const { getJs } = useUserStore();
|
||||||
@ -89,9 +64,12 @@ const dbFlag = ref(false);
|
|||||||
const qjId = ref('');
|
const qjId = ref('');
|
||||||
const showDkTab = ref(false);
|
const showDkTab = ref(false);
|
||||||
|
|
||||||
const dlgFlag = ref(false);
|
const spParams = computed(() => {
|
||||||
const rejectReason = ref("");
|
return {
|
||||||
|
qjId: qjId.value,
|
||||||
|
jsId: getJs.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// 构建Tab列表
|
// 构建Tab列表
|
||||||
const rebuildTabList = (showDk: boolean) => {
|
const rebuildTabList = (showDk: boolean) => {
|
||||||
@ -120,24 +98,7 @@ const handleDkListLoaded = (list: any[]) => {
|
|||||||
// 代课明细数据已由JsQjDetail组件处理
|
// 代课明细数据已由JsQjDetail组件处理
|
||||||
};
|
};
|
||||||
|
|
||||||
const showDlg = () => {
|
|
||||||
dlgFlag.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDlg = () => {
|
|
||||||
dlgFlag.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
const params = {
|
|
||||||
qjId: qjId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "approved",
|
|
||||||
spRemark: "同意",
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "确认中..." });
|
|
||||||
await jsQjDkQrApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({ url: '/pages/base/message/index' });
|
uni.reLaunch({ url: '/pages/base/message/index' });
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@ -145,20 +106,6 @@ const submit = async () => {
|
|||||||
|
|
||||||
// 驳回处理
|
// 驳回处理
|
||||||
const handleReject = async () => {
|
const handleReject = async () => {
|
||||||
if (!rejectReason.value.trim()) {
|
|
||||||
uni.showToast({ title: "请填写驳回意见", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
qjId: qjId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "rejected",
|
|
||||||
spRemark: rejectReason.value,
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "正在驳回..." });
|
|
||||||
await jsQjDkQrApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
closeDlg();
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({ url: '/pages/base/message/index' });
|
uni.reLaunch({ url: '/pages/base/message/index' });
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@ -36,35 +36,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="white-bg-color py-5">
|
<YwConfirm :api="jsQjJwcQrApi" :params="spParams"
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
@summit="submit" @reject="handleReject" />
|
||||||
<u-button text="驳回" class="ml-15 mr-7" :plain="true" @click="showDlg" />
|
|
||||||
<u-button text="同意" class="mr-15 mr-7" type="primary" @click="submit" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 驳回弹窗 -->
|
|
||||||
<u-popup
|
|
||||||
:show="dlgFlag"
|
|
||||||
mode="center"
|
|
||||||
:closeOnClickOverlay="false"
|
|
||||||
@close="closeDlg"
|
|
||||||
>
|
|
||||||
<view class="popup-content">
|
|
||||||
<view class="popup-title">驳回原因</view>
|
|
||||||
<u-input
|
|
||||||
v-model="rejectReason"
|
|
||||||
type="textarea"
|
|
||||||
placeholder="请填写驳回原因"
|
|
||||||
:autoHeight="true"
|
|
||||||
maxlength="200"
|
|
||||||
/>
|
|
||||||
<view class="popup-actions flex-row justify-end mt-4">
|
|
||||||
<u-button class="mr-2" @click="closeDlg">取消</u-button>
|
|
||||||
<u-button type="primary" @click="handleReject">确定</u-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</BasicLayout>
|
</BasicLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -78,6 +52,7 @@ import { ref } from "vue";
|
|||||||
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
||||||
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
||||||
import LcglSpList from "@/components/LcglSpList/index.vue";
|
import LcglSpList from "@/components/LcglSpList/index.vue";
|
||||||
|
import YwConfirm from "@/pages/components/YwConfirm/index.vue";
|
||||||
import { QjPageUtils } from "@/utils/qjPageUtils";
|
import { QjPageUtils } from "@/utils/qjPageUtils";
|
||||||
|
|
||||||
const { getJs } = useUserStore();
|
const { getJs } = useUserStore();
|
||||||
@ -90,9 +65,12 @@ const dbFlag = ref(false);
|
|||||||
const qjId = ref('');
|
const qjId = ref('');
|
||||||
const showDkTab = ref(false);
|
const showDkTab = ref(false);
|
||||||
|
|
||||||
const dlgFlag = ref(false);
|
const spParams = computed(() => {
|
||||||
const rejectReason = ref("");
|
return {
|
||||||
|
qjId: qjId.value,
|
||||||
|
jsId: getJs.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
// 构建Tab列表
|
// 构建Tab列表
|
||||||
const rebuildTabList = (showDk: boolean) => {
|
const rebuildTabList = (showDk: boolean) => {
|
||||||
@ -121,43 +99,12 @@ const handleDkListLoaded = (list: any[]) => {
|
|||||||
// 代课明细数据已由JsQjDetail组件处理
|
// 代课明细数据已由JsQjDetail组件处理
|
||||||
};
|
};
|
||||||
|
|
||||||
const showDlg = () => {
|
|
||||||
dlgFlag.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const closeDlg = () => {
|
|
||||||
dlgFlag.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
const params = {
|
|
||||||
qjId: qjId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "approved",
|
|
||||||
spRemark: "同意",
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "确认中..." });
|
|
||||||
await jsQjJwcQrApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
navigateBack();
|
navigateBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 驳回处理
|
// 驳回处理
|
||||||
const handleReject = async () => {
|
const handleReject = async () => {
|
||||||
if (!rejectReason.value.trim()) {
|
|
||||||
uni.showToast({ title: "请填写驳回意见", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
qjId: qjId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "rejected",
|
|
||||||
spRemark: rejectReason.value,
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "正在驳回..." });
|
|
||||||
await jsQjJwcQrApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
closeDlg();
|
|
||||||
navigateBack();
|
navigateBack();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -206,4 +153,5 @@ onLoad(async (data?: any) => {
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -57,7 +57,7 @@ const jfPzList = ref<any>([]);
|
|||||||
// 返回首页
|
// 返回首页
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/base/home/index"
|
url: "/pages/base/service/index"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -26,24 +26,9 @@
|
|||||||
<LcglSpList :yw-id="xkTf.id" yw-type="XK_TF" />
|
<LcglSpList :yw-id="xkTf.id" yw-type="XK_TF" />
|
||||||
</view>
|
</view>
|
||||||
<template #bottom>
|
<template #bottom>
|
||||||
<view class="white-bg-color py-5">
|
<YwConfirm :api="xkTfSpApi" :params="spParams"
|
||||||
<view class="flex-row items-center pb-10 pt-5">
|
@summit="submit" @reject="handleReject" />
|
||||||
<u-button text="驳回" class="ml-15 mr-7" :plain="true" @click="showDlg" />
|
|
||||||
<u-button text="同意" class="mr-15 mr-7" type="primary" @click="submit" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
<!-- 驳回弹窗 -->
|
|
||||||
<u-popup :show="dlgFlag" mode="center" :closeOnClickOverlay="false" @close="closeDlg">
|
|
||||||
<view class="popup-content">
|
|
||||||
<view class="popup-title">驳回原因</view>
|
|
||||||
<u-input v-model="rejectReason" type="textarea" placeholder="请填写驳回原因" :autoHeight="true" maxlength="200" />
|
|
||||||
<view class="popup-actions flex-row justify-end mt-4">
|
|
||||||
<u-button class="mr-2" @click="closeDlg">取消</u-button>
|
|
||||||
<u-button type="primary" @click="handleReject">确定</u-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</u-popup>
|
|
||||||
</BasicLayout>
|
</BasicLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -55,6 +40,7 @@ import XkPayXs from "../components/XkPayXs/index.vue"
|
|||||||
import XkPaySuccessXkkc from "../components/XkPaySuccessXkkc/index.vue"
|
import XkPaySuccessXkkc from "../components/XkPaySuccessXkkc/index.vue"
|
||||||
import LcglSpList from "@/components/LcglSpList/index.vue";
|
import LcglSpList from "@/components/LcglSpList/index.vue";
|
||||||
import PreviewImage from "@/components/PreviewImage/index.vue";
|
import PreviewImage from "@/components/PreviewImage/index.vue";
|
||||||
|
import YwConfirm from "@/pages/components/YwConfirm/index.vue";
|
||||||
import { getXkTfDetailByIdApi, xkTfSpApi } from "@/api/base/xkTfApi";
|
import { getXkTfDetailByIdApi, xkTfSpApi } from "@/api/base/xkTfApi";
|
||||||
import { XkTfPageUtils } from "@/utils/xkTfPageUtils";
|
import { XkTfPageUtils } from "@/utils/xkTfPageUtils";
|
||||||
const { getJs } = useUserStore();
|
const { getJs } = useUserStore();
|
||||||
@ -67,15 +53,12 @@ const jfPzList = ref<any>([]);
|
|||||||
const dbFlag = ref(false);
|
const dbFlag = ref(false);
|
||||||
const xkTfId = ref('');
|
const xkTfId = ref('');
|
||||||
|
|
||||||
const dlgFlag = ref(false);
|
const spParams = computed(() => {
|
||||||
const rejectReason = ref("");
|
return {
|
||||||
const showDlg = () => {
|
xkTfId: xkTfId.value,
|
||||||
dlgFlag.value = true;
|
jsId: getJs.id,
|
||||||
};
|
|
||||||
|
|
||||||
const closeDlg = () => {
|
|
||||||
dlgFlag.value = false;
|
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
@ -110,34 +93,11 @@ const loadData = async (id: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const submit = async () => {
|
const submit = async () => {
|
||||||
const params = {
|
|
||||||
xkTfId: xkTfId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "approved",
|
|
||||||
spRemark: "同意",
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "确认中..." });
|
|
||||||
await xkTfSpApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
goHome();
|
goHome();
|
||||||
};
|
};
|
||||||
|
|
||||||
// 驳回处理
|
// 驳回处理
|
||||||
const handleReject = async () => {
|
const handleReject = async () => {
|
||||||
if (!rejectReason.value.trim()) {
|
|
||||||
uni.showToast({ title: "请填写驳回意见", icon: "none" });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const params = {
|
|
||||||
xkTfId: xkTfId.value,
|
|
||||||
jsId: getJs.id,
|
|
||||||
spStatus: "rejected",
|
|
||||||
spRemark: rejectReason.value,
|
|
||||||
};
|
|
||||||
uni.showLoading({ title: "正在驳回..." });
|
|
||||||
await xkTfSpApi(params);
|
|
||||||
uni.hideLoading();
|
|
||||||
closeDlg();
|
|
||||||
goHome();
|
goHome();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user