123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <view class="px32rpx py24rpx">
- <view class="bg-white rounded-16rpx p-24rpx">
- <wd-select-picker
- label="补课课时"
- v-model="MakeUpClassId"
- :columns="data"
- placeholder="请选择补课课时"
- align-right
- type="radio"
- value-key="id"
- safe-area-inset-bottom
- label-key="name"
- ></wd-select-picker>
- <wd-divider color="#F0F0F0"></wd-divider>
- </view>
- <view class="mt20rpx bg-white rounded-16rpx p24rpx mb20rpx">
- <view class="mb20rpx">
- <wd-checkbox
- v-model="isCheckAll"
- size="large"
- shape="square"
- @change="handleCheckAllChange"
- ><text class="font-semibold text-32rpx">全选</text>
- </wd-checkbox>
- </view>
- <wd-checkbox-group
- v-model="checkedAll"
- inline
- size="large"
- shape="square"
- @change="handleChange"
- >
- <wd-checkbox
- :modelValue="item.familyUserId"
- v-for="item in userList"
- :key="item.familyUserId"
- >{{ item.familyUserName }}</wd-checkbox
- >
- </wd-checkbox-group>
- <view
- class="mt24rpx border border-gray border-solid rounded-xl overflow-hidden"
- >
- <wd-textarea
- v-model="postponeReason"
- placeholder="请填写延课原因"
- border
- />
- </view>
- </view>
- <WdButton block size="large" @click="handleSubmit">提交</WdButton>
- </view>
- </template>
- <script setup lang="ts">
- import router from "@/router";
- const isCheckAll = ref(false);
- const MakeUpClassId = ref<string>("");
- const checkedAll = ref<string[]>([]);
- const postponeReason = ref("");
- const priceRulesId = ref();
- const { send: getUserList, data: userList } = useRequest(
- (coursePriceRulesId) =>
- Apis.app.getClassPostponeUsers({ params: { coursePriceRulesId } }),
- { immediate: false },
- );
- const { data, send: getData } = useRequest(
- (id: string, coursesType: number) =>
- Apis.app.queryListByCoursesId({
- params: { coursesType, id },
- }),
- {
- immediate: false,
- },
- );
- const { send: submit } = useRequest(
- (data) =>
- Apis.app.classPostpone({
- data,
- }),
- {
- immediate: false,
- },
- );
- onLoad(async (query: any) => {
- priceRulesId.value = query.id;
- await getUserList(query.id);
- await getData(query.coursesId, 1);
- });
- function handleChange({ value }: any) {
- if (value.length == userList.value.length) {
- isCheckAll.value = true;
- } else {
- isCheckAll.value = false;
- }
- }
- function handleCheckAllChange() {
- if (isCheckAll.value) {
- checkedAll.value = userList.value.map((it) => it.familyUserId) as string[];
- } else {
- checkedAll.value = [];
- }
- }
- async function handleSubmit() {
- if (!MakeUpClassId.value)
- return uni.showToast({ title: "请选择补课课时", icon: "none" });
- if (checkedAll.value.length == 0)
- return uni.showToast({ title: "请选择补课学生", icon: "none" });
- if (!postponeReason.value)
- return uni.showToast({ title: "请填写延课原因", icon: "none" });
- await submit({
- coursePriceRulesId: MakeUpClassId.value,
- postponeReason: postponeReason.value,
- priceRulesId: priceRulesId.value,
- familyUserVOList: checkedAll.value.map((item) => {
- return {
- familyUserId: item,
- };
- }),
- });
- router.back();
- console.log(MakeUpClassId.value, "补课课时");
- }
- </script>
- <style scoped>
- :deep(.wd-select-picker__cell) {
- padding: 0 !important;
- }
- </style>
- <route lang="json">
- {
- "name": "ExtensionClass",
- "style": {
- "navigationBarTitleText": "填写延期信息",
- "disableScroll": true
- }
- }
- </route>
|