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) => {
|
||||
setParam({
|
||||
dbZt: tabIndex,
|
||||
jsrId: getJs.id
|
||||
jsrId: getJs.id,
|
||||
sidx: "xxtstime",
|
||||
sord: "desc",
|
||||
});
|
||||
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>
|
||||
<template #bottom>
|
||||
<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>
|
||||
</view>
|
||||
<YwConfirm :api="jsQjDkQrApi" :params="spParams"
|
||||
@summit="submit" @reject="handleReject" />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@ -77,6 +51,7 @@ import { ref } from "vue";
|
||||
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
||||
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
||||
import LcglSpList from "@/components/LcglSpList/index.vue";
|
||||
import YwConfirm from "@/pages/components/YwConfirm/index.vue";
|
||||
import { QjPageUtils } from "@/utils/qjPageUtils";
|
||||
|
||||
const { getJs } = useUserStore();
|
||||
@ -89,9 +64,12 @@ const dbFlag = ref(false);
|
||||
const qjId = ref('');
|
||||
const showDkTab = ref(false);
|
||||
|
||||
const dlgFlag = ref(false);
|
||||
const rejectReason = ref("");
|
||||
|
||||
const spParams = computed(() => {
|
||||
return {
|
||||
qjId: qjId.value,
|
||||
jsId: getJs.id,
|
||||
};
|
||||
});
|
||||
|
||||
// 构建Tab列表
|
||||
const rebuildTabList = (showDk: boolean) => {
|
||||
@ -120,24 +98,7 @@ const handleDkListLoaded = (list: any[]) => {
|
||||
// 代课明细数据已由JsQjDetail组件处理
|
||||
};
|
||||
|
||||
const showDlg = () => {
|
||||
dlgFlag.value = true;
|
||||
};
|
||||
|
||||
const closeDlg = () => {
|
||||
dlgFlag.value = false;
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
const params = {
|
||||
qjId: qjId.value,
|
||||
jsId: getJs.id,
|
||||
spStatus: "approved",
|
||||
spRemark: "同意",
|
||||
};
|
||||
uni.showLoading({ title: "确认中..." });
|
||||
await jsQjDkQrApi(params);
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
uni.reLaunch({ url: '/pages/base/message/index' });
|
||||
}, 1000);
|
||||
@ -145,20 +106,6 @@ const submit = 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(() => {
|
||||
uni.reLaunch({ url: '/pages/base/message/index' });
|
||||
}, 1000);
|
||||
|
||||
@ -36,35 +36,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<template #bottom>
|
||||
<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>
|
||||
</view>
|
||||
<YwConfirm :api="jsQjJwcQrApi" :params="spParams"
|
||||
@summit="submit" @reject="handleReject" />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@ -78,6 +52,7 @@ import { ref } from "vue";
|
||||
import JsQjDetailInfo from "./components/jsQjDetailInfo.vue";
|
||||
import JsQjDetailDk from "./components/jsQjDetailDk.vue";
|
||||
import LcglSpList from "@/components/LcglSpList/index.vue";
|
||||
import YwConfirm from "@/pages/components/YwConfirm/index.vue";
|
||||
import { QjPageUtils } from "@/utils/qjPageUtils";
|
||||
|
||||
const { getJs } = useUserStore();
|
||||
@ -90,9 +65,12 @@ const dbFlag = ref(false);
|
||||
const qjId = ref('');
|
||||
const showDkTab = ref(false);
|
||||
|
||||
const dlgFlag = ref(false);
|
||||
const rejectReason = ref("");
|
||||
|
||||
const spParams = computed(() => {
|
||||
return {
|
||||
qjId: qjId.value,
|
||||
jsId: getJs.id,
|
||||
};
|
||||
});
|
||||
|
||||
// 构建Tab列表
|
||||
const rebuildTabList = (showDk: boolean) => {
|
||||
@ -121,43 +99,12 @@ const handleDkListLoaded = (list: any[]) => {
|
||||
// 代课明细数据已由JsQjDetail组件处理
|
||||
};
|
||||
|
||||
const showDlg = () => {
|
||||
dlgFlag.value = true;
|
||||
};
|
||||
|
||||
const closeDlg = () => {
|
||||
dlgFlag.value = false;
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
const params = {
|
||||
qjId: qjId.value,
|
||||
jsId: getJs.id,
|
||||
spStatus: "approved",
|
||||
spRemark: "同意",
|
||||
};
|
||||
uni.showLoading({ title: "确认中..." });
|
||||
await jsQjJwcQrApi(params);
|
||||
uni.hideLoading();
|
||||
navigateBack();
|
||||
};
|
||||
|
||||
// 驳回处理
|
||||
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();
|
||||
};
|
||||
|
||||
@ -206,4 +153,5 @@ onLoad(async (data?: any) => {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -57,7 +57,7 @@ const jfPzList = ref<any>([]);
|
||||
// 返回首页
|
||||
const goHome = () => {
|
||||
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" />
|
||||
</view>
|
||||
<template #bottom>
|
||||
<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>
|
||||
</view>
|
||||
<YwConfirm :api="xkTfSpApi" :params="spParams"
|
||||
@summit="submit" @reject="handleReject" />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@ -55,6 +40,7 @@ import XkPayXs from "../components/XkPayXs/index.vue"
|
||||
import XkPaySuccessXkkc from "../components/XkPaySuccessXkkc/index.vue"
|
||||
import LcglSpList from "@/components/LcglSpList/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 { XkTfPageUtils } from "@/utils/xkTfPageUtils";
|
||||
const { getJs } = useUserStore();
|
||||
@ -67,15 +53,12 @@ const jfPzList = ref<any>([]);
|
||||
const dbFlag = ref(false);
|
||||
const xkTfId = ref('');
|
||||
|
||||
const dlgFlag = ref(false);
|
||||
const rejectReason = ref("");
|
||||
const showDlg = () => {
|
||||
dlgFlag.value = true;
|
||||
};
|
||||
|
||||
const closeDlg = () => {
|
||||
dlgFlag.value = false;
|
||||
};
|
||||
const spParams = computed(() => {
|
||||
return {
|
||||
xkTfId: xkTfId.value,
|
||||
jsId: getJs.id,
|
||||
};
|
||||
});
|
||||
|
||||
const goHome = () => {
|
||||
uni.reLaunch({
|
||||
@ -110,34 +93,11 @@ const loadData = async (id: string) => {
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
const params = {
|
||||
xkTfId: xkTfId.value,
|
||||
jsId: getJs.id,
|
||||
spStatus: "approved",
|
||||
spRemark: "同意",
|
||||
};
|
||||
uni.showLoading({ title: "确认中..." });
|
||||
await xkTfSpApi(params);
|
||||
uni.hideLoading();
|
||||
goHome();
|
||||
};
|
||||
|
||||
// 驳回处理
|
||||
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();
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user