|  | @@ -3,23 +3,24 @@
 | 
	
		
			
				|  |  |      <view class="bg-white rounded-16rpx p-24rpx">
 | 
	
		
			
				|  |  |        <wd-select-picker
 | 
	
		
			
				|  |  |          label="补课课时"
 | 
	
		
			
				|  |  | -        v-model="value"
 | 
	
		
			
				|  |  | -        :columns="columns"
 | 
	
		
			
				|  |  | +        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 class="flex items-center justify-end mt24rpx">
 | 
	
		
			
				|  |  | -        <view class="text-24rpx text-[rgb(0,0,0,0.3)]"
 | 
	
		
			
				|  |  | -          >未找到合适的补课课时,<text class="text-#0074FF">去新增</text>
 | 
	
		
			
				|  |  | -        </view>
 | 
	
		
			
				|  |  | -      </view>
 | 
	
		
			
				|  |  |      </view>
 | 
	
		
			
				|  |  |      <view class="mt20rpx bg-white rounded-16rpx p24rpx mb20rpx">
 | 
	
		
			
				|  |  |        <view class="mb20rpx">
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop" size="large" shape="square"
 | 
	
		
			
				|  |  | +        <wd-checkbox
 | 
	
		
			
				|  |  | +          v-model="isCheckAll"
 | 
	
		
			
				|  |  | +          size="large"
 | 
	
		
			
				|  |  | +          shape="square"
 | 
	
		
			
				|  |  | +          @change="handleCheckAllChange"
 | 
	
		
			
				|  |  |            ><text class="font-semibold text-32rpx">全选</text>
 | 
	
		
			
				|  |  |          </wd-checkbox>
 | 
	
		
			
				|  |  |        </view>
 | 
	
	
		
			
				|  | @@ -28,42 +29,100 @@
 | 
	
		
			
				|  |  |          inline
 | 
	
		
			
				|  |  |          size="large"
 | 
	
		
			
				|  |  |          shape="square"
 | 
	
		
			
				|  |  | +        @change="handleChange"
 | 
	
		
			
				|  |  |        >
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="jingmai">张三</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | -        <wd-checkbox modelValue="shop">李四</wd-checkbox>
 | 
	
		
			
				|  |  | +        <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">提交</WdButton>
 | 
	
		
			
				|  |  | +    <WdButton block size="large" @click="handleSubmit">提交</WdButton>
 | 
	
		
			
				|  |  |    </view>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script setup lang="ts">
 | 
	
		
			
				|  |  | -const columns = ref<Record<string, any>[]>([
 | 
	
		
			
				|  |  | -  {
 | 
	
		
			
				|  |  | -    value: "101",
 | 
	
		
			
				|  |  | -    label: "男装",
 | 
	
		
			
				|  |  | -  },
 | 
	
		
			
				|  |  | +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 },
 | 
	
		
			
				|  |  | +    }),
 | 
	
		
			
				|  |  |    {
 | 
	
		
			
				|  |  | -    value: "102",
 | 
	
		
			
				|  |  | -    label: "奢侈品",
 | 
	
		
			
				|  |  | +    immediate: false,
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +const { send: submit } = useRequest(
 | 
	
		
			
				|  |  | +  (data) =>
 | 
	
		
			
				|  |  | +    Apis.app.classPostpone({
 | 
	
		
			
				|  |  | +      data,
 | 
	
		
			
				|  |  | +    }),
 | 
	
		
			
				|  |  |    {
 | 
	
		
			
				|  |  | -    value: "103",
 | 
	
		
			
				|  |  | -    label: "女装",
 | 
	
		
			
				|  |  | +    immediate: false,
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | -]);
 | 
	
		
			
				|  |  | -const value = ref<string>("101");
 | 
	
		
			
				|  |  | -const checkedAll = ref(["1"]);
 | 
	
		
			
				|  |  | +);
 | 
	
		
			
				|  |  | +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>
 | 
	
	
		
			
				|  | @@ -75,7 +134,8 @@ const checkedAll = ref(["1"]);
 | 
	
		
			
				|  |  |  {
 | 
	
		
			
				|  |  |    "name": "ExtensionClass",
 | 
	
		
			
				|  |  |    "style": {
 | 
	
		
			
				|  |  | -    "navigationBarTitleText": "填写延期信息"
 | 
	
		
			
				|  |  | +    "navigationBarTitleText": "填写延期信息",
 | 
	
		
			
				|  |  | +    "disableScroll": true
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </route>
 |