210 lines
4.8 KiB
Vue
Raw Normal View History

<template>
2025-09-15 23:49:21 +08:00
<BasicLayout>
<view class="xkTf-info">
<!-- 学生信息卡片 -->
<XkPayXs :xs="curXs" />
<!-- 课程信息卡片 -->
<XkPaySuccessXkkc :dataList="xkTfQdList" />
<!-- 退费信息卡片 -->
<view class="xkTf-card">
<view class="card-body">
<view class="info-column">
<text class="label">退费说明:</text>
<text class="value">{{ xkTf.tfSm }}</text>
</view>
<view class="info-column">
<text class="label">缴费凭证:</text>
<text class="value">
<PreviewImage :image-list="jfPzList" empty-text="无缴费凭证" />
</text>
</view>
</view>
</view>
<!-- 审批流程 -->
<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>
</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>
2025-09-15 23:49:21 +08:00
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app";
import { useUserStore } from "@/store/modules/user";
import { imagUrl } from "@/utils";
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 { getXkTfDetailByIdApi, xkTfSpApi } from "@/api/base/xkTfApi";
import { XkTfPageUtils } from "@/utils/xkTfPageUtils";
const { getJs } = useUserStore();
const curXs = ref<any>({});
const xkTf = ref<any>({});
const xkTfQdList = ref<any>([]);
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 goHome = () => {
uni.reLaunch({
url: "/pages/base/service/index"
});
};
// 初始化数据
const initData = (tf: any, xs: any, tfQdList: any[]) => {
if (xs) {
xs.xstxUrl = imagUrl(xs.xstx) || "";
}
console.log('initData学生', xs);
curXs.value = xs;
xkTf.value = tf;
xkTfQdList.value = tfQdList;
const jfPz = tf.jfPz || '';
// 缴费凭证逗号分隔
jfPzList.value = jfPz.split(',') || [];
};
// 获取详情
const loadData = async (id: string) => {
const res = await getXkTfDetailByIdApi(id);
if (!res.result) {
uni.showToast({ title: '未找到数据', icon: 'none' });
goHome();
}
nextTick(() => {
initData(res.result.xkTf, res.result.xs, res.result.xkTfQdList);
});
};
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();
};
onLoad(async (data?: any) => {
const ret = await XkTfPageUtils.init(data);
if (!ret || !ret.success) {
return;
}
2025-09-15 23:49:21 +08:00
xkTfId.value = ret.xkTfId;
dbFlag.value = ret.dbFlag;
await loadData(xkTfId.value);
});
</script>
2025-09-15 23:49:21 +08:00
<style lang="scss" scoped>
.xkTf-info {
background-color: #f5f7fa;
.xkTf-card {
margin: 15px;
background-color: #fff;
border-radius: 8px;
padding: 15px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
.card-body {
.info-row {
display: flex;
margin-bottom: 10px;
.label {
font-size: 14px;
color: #bbb;
width: 70px;
flex-shrink: 0;
margin-right: 8px;
}
2025-09-15 23:49:21 +08:00
.value {
font-size: 14px;
color: #333;
flex: 1;
}
}
.info-column {
display: flex;
flex-direction: column;
.label {
font-size: 14px;
color: #bbb;
flex-shrink: 0;
margin-right: 8px;
width: 100%;
margin-bottom: 5px;
}
.value {
font-size: 14px;
color: #333;
flex: 1;
margin-bottom: 10px;
}
}
}
}
}
</style>