|
@@ -3,7 +3,7 @@
|
|
|
import { useTable } from '/@/components/Table';
|
|
|
import BasicModal from '/@/components/Modal/src/BasicModal.vue';
|
|
|
import { changeColumns, textbookColumns } from './data.config';
|
|
|
- import { ref } from 'vue';
|
|
|
+ import { reactive, ref } from 'vue';
|
|
|
import BasicTable from '/@/components/Table/src/BasicTable.vue';
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
import { getTextbookPage } from '/@/services/apis/TextbookController';
|
|
@@ -15,9 +15,15 @@
|
|
|
const visible = ref(false);
|
|
|
const changeType = ref(0);
|
|
|
const changeId = ref<string>('');
|
|
|
+ const rawValue = reactive({
|
|
|
+ studentSubscriptionNumber: 0,
|
|
|
+ teacherSubscriptionNumber: 0,
|
|
|
+ });
|
|
|
const [register, { closeModal, setModalProps }] = useModalInner((data) => {
|
|
|
changeId.value = data.id;
|
|
|
dataSource.value = [data];
|
|
|
+ rawValue.studentSubscriptionNumber = data.studentSubscriptionNumber;
|
|
|
+ rawValue.teacherSubscriptionNumber = data.teacherSubscriptionNumber;
|
|
|
});
|
|
|
const [selectTableRef, { getSelectRows, clearSelectedRowKeys }] = useTable({
|
|
|
title: '可选课程信息',
|
|
@@ -77,7 +83,16 @@
|
|
|
if (changeType.value === 0) {
|
|
|
return createMessage.warning('您未进行任何变更,请选择变更课程或者变更征订数量后提交');
|
|
|
}
|
|
|
+
|
|
|
const value = dataSource.value[0];
|
|
|
+ if (changeType.value === 1) {
|
|
|
+ if (
|
|
|
+ rawValue.studentSubscriptionNumber === value.studentSubscriptionNumber &&
|
|
|
+ rawValue.teacherSubscriptionNumber === value.teacherSubscriptionNumber
|
|
|
+ ) {
|
|
|
+ return createMessage.warning('您未进行任何变更,请选择变更课程或者变更征订数量后提交');
|
|
|
+ }
|
|
|
+ }
|
|
|
if (changeType.value === 2) {
|
|
|
value.courseSubjectId = value.id;
|
|
|
}
|