138 lines
3.0 KiB
Vue
Raw Normal View History

<template>
2025-07-26 21:29:04 +08:00
<BasicLayout>
<JsQjDetail :qjId="qjId" :dbFlag="dbFlag" v-if="qjId && qjId.length" />
2025-07-27 23:37:02 +08:00
<!-- 驳回弹窗 -->
<u-popup
2025-08-29 01:27:54 +08:00
:show="dlgFlag"
2025-07-27 23:37:02 +08:00
mode="center"
:closeOnClickOverlay="false"
2025-08-29 01:27:54 +08:00
@close="closeDlg"
2025-07-27 23:37:02 +08:00
>
<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">
2025-08-29 01:27:54 +08:00
<u-button class="mr-2" @click="closeDlg">取消</u-button>
2025-07-27 23:37:02 +08:00
<u-button type="primary" @click="handleReject">确定</u-button>
</view>
</view>
</u-popup>
2025-07-26 21:29:04 +08:00
<template #bottom>
<view class="white-bg-color py-5">
2025-07-27 23:37:02 +08:00
<view class="divider"></view>
2025-07-26 21:29:04 +08:00
<view class="flex-row items-center pb-10 pt-5">
<u-button
text="驳回"
class="ml-15 mr-7"
:plain="true"
2025-08-29 01:27:54 +08:00
@click="showDlg"
2025-07-26 21:29:04 +08:00
/>
<u-button
text="同意"
class="mr-15 mr-7"
type="primary"
@click="submit"
/>
</view>
</view>
</template>
</BasicLayout>
</template>
<script setup lang="ts">
2025-08-29 01:27:54 +08:00
import { jsQjJwcQrApi } from "@/api/base/jsQjApi";
2025-07-27 23:37:02 +08:00
import { useUserStore } from "@/store/modules/user";
import { navigateBack } from "@/utils/uniapp";
import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import JsQjDetail from "./components/jsQjDetail.vue";
2025-08-29 01:27:54 +08:00
const { getJs } = useUserStore();
2025-08-29 01:27:54 +08:00
const dbFlag = ref(false);
2025-07-26 21:29:04 +08:00
const qjId = ref<string>();
2025-08-29 01:27:54 +08:00
const dlgFlag = ref(false);
2025-07-27 23:37:02 +08:00
const rejectReason = ref("");
2025-07-26 21:29:04 +08:00
const submit = async () => {
2025-07-27 23:37:02 +08:00
const params = {
qjId: qjId.value,
jsId: getJs.id,
2025-08-29 01:27:54 +08:00
spStatus: "approved",
spRemark: "同意",
2025-07-27 23:37:02 +08:00
};
2025-08-29 01:27:54 +08:00
uni.showLoading({ title: "确认中..." });
2025-07-27 23:37:02 +08:00
await jsQjJwcQrApi(params);
2025-07-26 21:29:04 +08:00
uni.hideLoading();
navigateBack();
};
2025-08-29 01:27:54 +08:00
const showDlg = () => {
dlgFlag.value = true;
2025-07-27 23:37:02 +08:00
};
2025-08-29 01:27:54 +08:00
const closeDlg = () => {
dlgFlag.value = false;
2025-07-27 23:37:02 +08:00
};
// 驳回处理
const handleReject = async () => {
if (!rejectReason.value.trim()) {
uni.showToast({ title: "请填写驳回意见", icon: "none" });
return;
}
2025-08-29 01:27:54 +08:00
const params = {
2025-07-27 23:37:02 +08:00
qjId: qjId.value,
jsId: getJs.id,
2025-08-29 01:27:54 +08:00
spStatus: "rejected",
spRemark: rejectReason.value,
2025-07-27 23:37:02 +08:00
};
uni.showLoading({ title: "正在驳回..." });
2025-08-29 01:27:54 +08:00
await jsQjJwcQrApi(params);
uni.hideLoading();
closeDlg();
navigateBack();
2025-07-27 23:37:02 +08:00
};
2025-08-29 01:27:54 +08:00
onLoad((options) => {
if (options.qjId) {
qjId.value = options.qjId;
2025-07-27 23:37:02 +08:00
}
2025-08-29 01:27:54 +08:00
if (options.dbFlag) {
dbFlag.value = options.dbFlag === "true";
}
});
2025-07-26 21:29:04 +08:00
</script>
2025-07-27 23:37:02 +08:00
2025-08-29 01:27:54 +08:00
<style lang="scss" scoped>
2025-07-27 23:37:02 +08:00
.popup-content {
2025-08-29 01:27:54 +08:00
background-color: white;
border-radius: 8px;
padding: 20px;
width: 300px;
2025-07-27 23:37:02 +08:00
}
2025-08-29 01:27:54 +08:00
2025-07-27 23:37:02 +08:00
.popup-title {
font-size: 16px;
font-weight: bold;
2025-08-29 01:27:54 +08:00
margin-bottom: 15px;
text-align: center;
2025-07-27 23:37:02 +08:00
}
2025-08-29 01:27:54 +08:00
2025-07-27 23:37:02 +08:00
.popup-actions {
2025-08-29 01:27:54 +08:00
margin-top: 20px;
}
.divider {
height: 1px;
background-color: #eee;
margin: 0 15px;
2025-07-27 23:37:02 +08:00
}
</style>