2025-09-16 11:13:17 +08:00
|
|
|
<template>
|
2025-09-20 23:05:04 +08:00
|
|
|
<view class="white-bg-color py-5 yw-confirm">
|
|
|
|
|
<view class="flex-row items-center pt-5 pb-10">
|
|
|
|
|
<u-button text="驳回" class="ml-15 mr-7" :plain="true" @click="showDlg('reject')" />
|
2025-09-22 22:20:00 +08:00
|
|
|
<u-button text="同意" class="mr-15 ml-7" type="primary" @click="submit" />
|
2025-09-20 23:05:04 +08:00
|
|
|
</view>
|
2025-09-22 22:20:00 +08:00
|
|
|
<view class="flex-row items-center pb-10">
|
2025-09-20 23:05:04 +08:00
|
|
|
<u-button text="终止" class="ml-15 mr-7" :plain="true" @click="showDlg('stop')" />
|
2025-09-22 22:20:00 +08:00
|
|
|
<u-button text="转办" class="mr-15 ml-7" :plain="true" @click="showTransfer" />
|
2025-09-22 18:11:59 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="flex-row items-center pb-5">
|
2025-09-22 22:20:59 +08:00
|
|
|
<u-button text="同意并协调代课教师" class="mr-15 ml-15" :plain="true" @click="showXtDlg" />
|
2025-09-16 11:13:17 +08:00
|
|
|
</view>
|
|
|
|
|
<!-- 驳回弹窗 -->
|
|
|
|
|
<u-popup :show="dlgFlag" mode="center" :closeOnClickOverlay="false" @close="closeDlg">
|
|
|
|
|
<view class="popup-content">
|
|
|
|
|
<view class="popup-header">
|
2025-09-20 23:05:04 +08:00
|
|
|
<view class="popup-title">{{ dlgTips }}</view>
|
2025-09-16 11:13:17 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="popup-body">
|
2025-09-20 23:05:04 +08:00
|
|
|
<u-input v-model="spRemark" type="textarea" :placeholder="'请填写' + dlgTips" :autoHeight="true" maxlength="200" class="reject-reason-input" />
|
2025-09-16 11:13:17 +08:00
|
|
|
</view>
|
|
|
|
|
<view class="popup-actions flex-row justify-end mt-4">
|
|
|
|
|
<u-button class="mr-2" @click="closeDlg">取消</u-button>
|
2025-09-20 23:05:04 +08:00
|
|
|
<u-button type="primary" @click="handleDlgSubmit">确定</u-button>
|
2025-09-16 11:13:17 +08:00
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
2025-09-20 23:05:04 +08:00
|
|
|
<YwTransfer ref="transferRef" @submit="handleTransfer" />
|
2025-09-22 18:11:59 +08:00
|
|
|
<XtDkJs ref="xtDkJsRef" @submit="handleXtDkJs" />
|
2025-09-16 11:13:17 +08:00
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2025-09-20 23:05:04 +08:00
|
|
|
import YwTransfer from "../YwTransfer/index.vue";
|
2025-09-22 21:21:28 +08:00
|
|
|
import XtDkJs from "@/pages/view/hr/jsQj/components/XtDkJs.vue";
|
2025-09-22 22:20:00 +08:00
|
|
|
import { useDataStore } from "@/store/modules/data";
|
|
|
|
|
const { getLcgl } = useDataStore();
|
2025-09-20 23:05:04 +08:00
|
|
|
|
2025-09-16 11:13:17 +08:00
|
|
|
// 接收外部传入属性并设置默认值
|
|
|
|
|
const props = withDefaults(defineProps<{
|
2025-09-20 23:05:04 +08:00
|
|
|
spApi: any, // 审批Api
|
|
|
|
|
transferApi: any, // 转办Api
|
|
|
|
|
stopApi: any, // 终止Api
|
2025-09-22 22:20:00 +08:00
|
|
|
xtDkApi?: any, // 协调代课Api
|
2025-09-16 11:13:17 +08:00
|
|
|
params: any, // 默认的请求参数
|
|
|
|
|
stausName?: string, // 默认的状态属性名
|
|
|
|
|
remarkName?: string, // 默认的审批说明属性名
|
|
|
|
|
approvedValue?: string, // 默认的同意时的状态值
|
|
|
|
|
rejectValue?: string, // 默认的拒绝时的状态值
|
2025-09-20 23:05:04 +08:00
|
|
|
approvedRemark?: string //
|
|
|
|
|
autoToMessage?: boolean // 默认自动跳转到待办页面
|
2025-09-22 18:11:59 +08:00
|
|
|
showXt?: boolean
|
2025-09-16 11:13:17 +08:00
|
|
|
}>(), {
|
2025-09-20 23:05:04 +08:00
|
|
|
spApi: async (params: any) => {},
|
|
|
|
|
transferApi: async (params: any) => {},
|
|
|
|
|
stopApi: async (params: any) => {},
|
2025-09-16 11:13:17 +08:00
|
|
|
params: {},
|
|
|
|
|
stausName: 'spStatus',
|
|
|
|
|
remarkName: 'spRemark',
|
|
|
|
|
approvedValue: 'approved',
|
|
|
|
|
rejectValue: 'rejected',
|
2025-09-20 23:05:04 +08:00
|
|
|
approvedRemark: '同意',
|
2025-09-22 18:11:59 +08:00
|
|
|
autoToMessage: true,
|
|
|
|
|
showXt: false
|
2025-09-16 11:13:17 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 定义一个上级传入的emit响应事件用于接收数据变更
|
2025-09-20 23:05:04 +08:00
|
|
|
const emit = defineEmits(['submit', 'reject', 'stop', 'transfer'])
|
|
|
|
|
|
|
|
|
|
const transferRef = ref<any>(null);
|
2025-09-22 18:11:59 +08:00
|
|
|
const xtDkJsRef = ref<any>(null);
|
2025-09-16 11:13:17 +08:00
|
|
|
|
|
|
|
|
const dlgFlag = ref(false);
|
2025-09-20 23:05:04 +08:00
|
|
|
const dlgType = ref("");
|
|
|
|
|
const dlgTips = ref("");
|
|
|
|
|
const spRemark = ref("");
|
|
|
|
|
|
|
|
|
|
const goToMessage = () => {
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.reLaunch({ url: '/pages/base/message/index' });
|
|
|
|
|
}, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const showDlg = (type: string) => {
|
2025-09-16 11:13:17 +08:00
|
|
|
dlgFlag.value = true;
|
2025-09-20 23:05:04 +08:00
|
|
|
dlgType.value = type;
|
|
|
|
|
if (type === 'reject') {
|
|
|
|
|
dlgTips.value = '驳回原因';
|
|
|
|
|
} else if (type === 'stop') {
|
|
|
|
|
dlgTips.value = '终止原因';
|
|
|
|
|
}
|
2025-09-16 11:13:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const closeDlg = () => {
|
|
|
|
|
dlgFlag.value = false;
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-20 23:05:04 +08:00
|
|
|
const showTransfer = () => {
|
|
|
|
|
transferRef.value.showDlg();
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-22 18:11:59 +08:00
|
|
|
const showXtDlg = () => {
|
2025-09-22 22:20:00 +08:00
|
|
|
xtDkJsRef.value.showDlg();
|
2025-09-22 18:11:59 +08:00
|
|
|
};
|
|
|
|
|
|
2025-09-16 11:13:17 +08:00
|
|
|
const submit = async () => {
|
|
|
|
|
const params = {
|
|
|
|
|
...props.params
|
|
|
|
|
};
|
|
|
|
|
params[props.stausName] = props.approvedValue;
|
2025-09-20 23:05:04 +08:00
|
|
|
params[props.remarkName] = props.approvedRemark;
|
2025-09-16 11:13:17 +08:00
|
|
|
uni.showLoading({ title: "确认中..." });
|
2025-09-20 23:05:04 +08:00
|
|
|
await props.spApi(params);
|
2025-09-16 11:13:17 +08:00
|
|
|
uni.hideLoading();
|
|
|
|
|
closeDlg();
|
2025-09-20 23:05:04 +08:00
|
|
|
if (props.autoToMessage) {
|
|
|
|
|
goToMessage();
|
|
|
|
|
}
|
2025-09-16 11:13:17 +08:00
|
|
|
emit('submit');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 驳回处理
|
2025-09-20 23:05:04 +08:00
|
|
|
const handleReject = async (params: any) => {
|
|
|
|
|
uni.showLoading({ title: "正在驳回..." });
|
|
|
|
|
await props.spApi(params);
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
emit('reject');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 终止处理
|
|
|
|
|
const handleStop = async (params: any) => {
|
|
|
|
|
uni.showLoading({ title: "正在终止..." });
|
|
|
|
|
await props.stopApi(params);
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
emit('stop');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 转办处理
|
|
|
|
|
const handleTransfer = async (data: any) => {
|
2025-09-16 11:13:17 +08:00
|
|
|
const params = {
|
|
|
|
|
...props.params
|
|
|
|
|
};
|
2025-09-20 23:05:04 +08:00
|
|
|
const newSprList = data.newSprList || [];
|
|
|
|
|
const newCsrList = data.newCsrList || [];
|
|
|
|
|
params.spRemark = data.spRemark;
|
|
|
|
|
params.zbrIds = newSprList.map((item: any) => item.userId).join(",");
|
|
|
|
|
params.csrIds = newCsrList.map((item: any) => item.userId).join(",");
|
|
|
|
|
uni.showLoading({ title: "正在转办..." });
|
|
|
|
|
await props.transferApi(params);
|
|
|
|
|
transferRef.value.closeDlg();
|
2025-09-16 11:13:17 +08:00
|
|
|
uni.hideLoading();
|
2025-09-20 23:05:04 +08:00
|
|
|
emit('transfer');
|
2025-09-22 11:00:11 +08:00
|
|
|
if (props.autoToMessage) {
|
|
|
|
|
goToMessage();
|
|
|
|
|
}
|
2025-09-20 23:05:04 +08:00
|
|
|
};
|
|
|
|
|
|
2025-09-22 18:11:59 +08:00
|
|
|
// 转办处理
|
|
|
|
|
const handleXtDkJs = async (data: any) => {
|
|
|
|
|
const params = {
|
|
|
|
|
...props.params
|
|
|
|
|
};
|
|
|
|
|
params.spRemark = data.spRemark;
|
2025-09-22 22:20:00 +08:00
|
|
|
params.dkList = data.dkList;
|
|
|
|
|
params.csrList = (getLcgl.csrSpList || []).map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
userId: item.userId,
|
|
|
|
|
jsxm: item.userName
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
uni.showLoading({ title: "正在协调..." });
|
|
|
|
|
await props.xtDkApi(params);
|
2025-09-22 18:11:59 +08:00
|
|
|
transferRef.value.closeDlg();
|
|
|
|
|
uni.hideLoading();
|
|
|
|
|
emit('transfer');
|
|
|
|
|
if (props.autoToMessage) {
|
|
|
|
|
goToMessage();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-20 23:05:04 +08:00
|
|
|
const handleDlgSubmit = async () => {
|
|
|
|
|
if (!spRemark.value || !spRemark.value.trim()) {
|
|
|
|
|
uni.showToast({ title: "请填写" + dlgTips.value, icon: "none" });
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const params = {
|
|
|
|
|
...props.params
|
|
|
|
|
};
|
|
|
|
|
params[props.stausName] = props.rejectValue;
|
|
|
|
|
params[props.remarkName] = spRemark.value;
|
|
|
|
|
if (dlgType.value === 'reject') {
|
|
|
|
|
await handleReject(params);
|
|
|
|
|
} else if (dlgType.value === 'stop') {
|
|
|
|
|
await handleStop(params);
|
|
|
|
|
} else if (dlgType.value === 'transfer') {
|
|
|
|
|
await handleTransfer(params);
|
|
|
|
|
}
|
2025-09-16 11:13:17 +08:00
|
|
|
closeDlg();
|
2025-09-20 23:05:04 +08:00
|
|
|
if (props.autoToMessage) {
|
|
|
|
|
goToMessage();
|
|
|
|
|
}
|
2025-09-16 11:13:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
|
showDlg,
|
|
|
|
|
closeDlg
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2025-09-20 23:05:04 +08:00
|
|
|
.yw-confirm {
|
|
|
|
|
box-shadow: 0 -0.1rem 0.5rem rgba(0, 0, 0, 0.1);
|
|
|
|
|
margin-top: 8rpx;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-16 11:13:17 +08:00
|
|
|
.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>
|