Browse Source

改价/分班bug修复

学习?学个屁 1 week ago
parent
commit
e431272480

+ 4 - 4
.env.development

@@ -7,20 +7,20 @@ VITE_PUBLIC_PATH = /
 
 
 
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
-VITE_PROXY = [["/jeecgboot","http://192.168.0.217:8080/jeecg-boot"],["/upload","http://192.168.0.217:8080/jeecg-boot"]]
+# VITE_PROXY = [["/jeecgboot","http://192.168.0.217:8080/jeecg-boot"],["/upload","http://192.168.0.217:8080/jeecg-boot"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.0.11:8080/jeecg-boot"],["/upload","http://192.168.0.11:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.0.11:8080/jeecg-boot"],["/upload","http://192.168.0.11:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.1.253:8080/jeecg-boot"],["/upload","http://192.168.1.253:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.1.253:8080/jeecg-boot"],["/upload","http://192.168.1.253:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.1.166:8080/jeecg-boot"],["/upload","http://192.168.1.166:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://192.168.1.166:8080/jeecg-boot"],["/upload","http://192.168.1.166:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://47.109.18.141:8080/jeecg-boot"],["/upload","http://47.109.18.141:8080/upload"]]
 # VITE_PROXY = [["/jeecgboot","http://47.109.18.141:8080/jeecg-boot"],["/upload","http://47.109.18.141:8080/upload"]]
-# VITE_PROXY = [["/jeecgboot","https://api.qlapp.cn/jeecg-boot"],["/upload","https://api.qlapp.cn/upload"]]
+VITE_PROXY = [["/jeecgboot","https://api.qlapp.cn/jeecgboot"],["/upload","https://api.qlapp.cn/upload"]]
 
 
 #后台接口全路径地址(必填)
 #后台接口全路径地址(必填)
-VITE_GLOB_DOMAIN_URL=http://192.168.0.217:8080/jeecg-boot #//黄
+# VITE_GLOB_DOMAIN_URL=http://192.168.0.217:8080/jeecg-boot #//黄
 # VITE_GLOB_DOMAIN_URL=http://192.168.0.11:8080/jeecg-boot  #李
 # VITE_GLOB_DOMAIN_URL=http://192.168.0.11:8080/jeecg-boot  #李
 # VITE_GLOB_DOMAIN_URL=http://192.168.1.253:8080/jeecg-boot  #张
 # VITE_GLOB_DOMAIN_URL=http://192.168.1.253:8080/jeecg-boot  #张
 # VITE_GLOB_DOMAIN_URL=http://192.168.1.166:8080/jeecg-boot  #张
 # VITE_GLOB_DOMAIN_URL=http://192.168.1.166:8080/jeecg-boot  #张
 # VITE_GLOB_DOMAIN_URL=http://47.109.18.141:8080/jeecg-boot  #fwq
 # VITE_GLOB_DOMAIN_URL=http://47.109.18.141:8080/jeecg-boot  #fwq
-# VITE_GLOB_DOMAIN_URL=https://api.qlapp.cn/jeecg-boot  #fwq
+VITE_GLOB_DOMAIN_URL=https://api.qlapp.cn/jeecgboot  #fwq
 
 
 #后台接口父地址(必填)
 #后台接口父地址(必填)
 VITE_GLOB_API_URL=/jeecgboot
 VITE_GLOB_API_URL=/jeecgboot

+ 4 - 0
src/components/ZtCustomTable/index.vue

@@ -95,6 +95,10 @@
       record.editValueRefs.time.value = value;
       record.editValueRefs.time.value = value;
       return;
       return;
     }
     }
+    if(column.key == 'InputNumber'){
+      record.editValueRefs[column.dataIndex].value = Number(value);
+      return;
+    }
     record.editValueRefs[column.dataIndex].value = `${value}`;
     record.editValueRefs[column.dataIndex].value = `${value}`;
   }
   }
   type DataRow = Record<string, any> & {
   type DataRow = Record<string, any> & {

+ 35 - 21
src/views/businessManagement/schoolOpen/index.vue

@@ -54,7 +54,7 @@
   </div>
   </div>
 </template>
 </template>
 <script lang="ts" setup name="business-management-schoolOpen">
 <script lang="ts" setup name="business-management-schoolOpen">
-  import { TypographyTitle, Divider, QRCode } from 'ant-design-vue';
+  import { TypographyTitle, Divider, QRCode, message } from 'ant-design-vue';
   import { BasicForm, useForm, ApiSelect } from '/@/components/Form/index';
   import { BasicForm, useForm, ApiSelect } from '/@/components/Form/index';
   import ZtCustomTable from '/@/components/ZtCustomTable/index.vue';
   import ZtCustomTable from '/@/components/ZtCustomTable/index.vue';
   import { Business } from '../gymnasiumBag/gymnasiumBag.api';
   import { Business } from '../gymnasiumBag/gymnasiumBag.api';
@@ -64,6 +64,7 @@
   import { ref, unref } from 'vue';
   import { ref, unref } from 'vue';
   import { useRouter } from 'vue-router';
   import { useRouter } from 'vue-router';
   import { storeToRefs } from 'pinia';
   import { storeToRefs } from 'pinia';
+  import { areAllItemsAllFieldsFilled } from '@/utils';
 
 
   const { userInfo, getIsMerchant } = storeToRefs(useUserStore());
   const { userInfo, getIsMerchant } = storeToRefs(useUserStore());
   const router = useRouter();
   const router = useRouter();
@@ -81,30 +82,41 @@
     await validate();
     await validate();
     isSubmit.value = true;
     isSubmit.value = true;
     const form = await getFieldsValue();
     const form = await getFieldsValue();
-    console.log(form, 'formData');
+    console.log(form.noTeachingDay, 'form', form.teachingDay);
+    const newNoTeachingDay = form.noTeachingDay.map((it) => {
+      return {
+        ticketNum: it.editValueRefs.ticketNum ? unref(it.editValueRefs.ticketNum) : null,
+        startTime: it.editValueRefs.time ? unref(it.editValueRefs.time)[0] : null,
+        endTime: it.editValueRefs.time ? unref(it.editValueRefs.time)[1] : null,
+      };
+    });
+    const newTeachingDay = form.teachingDay.map((it) => {
+      return {
+        ticketNum: it.editValueRefs.ticketNum ? unref(it.editValueRefs.ticketNum) : null,
+        startTime: it.editValueRefs.time ? unref(it.editValueRefs.time)[0] : null,
+        endTime: it.editValueRefs.time ? unref(it.editValueRefs.time)[1] : null,
+      };
+    });
+    if (!areAllItemsAllFieldsFilled(newTeachingDay)) {
+      isSubmit.value = false;
+      return message.error('请填写完整的教学日信息');
+    }
+    if (!areAllItemsAllFieldsFilled(newNoTeachingDay)) {
+      isSubmit.value = false;
+
+      return message.error('请填写完整的非教学日信息');
+    }
 
 
     const newObj = {
     const newObj = {
       ...form,
       ...form,
       noTeachingDay: JSON.stringify({
       noTeachingDay: JSON.stringify({
-        data: form.noTeachingDay.map((it) => {
-          return {
-            ticketNum: unref(it.editValueRefs.ticketNum),
-            startTime: unref(it.editValueRefs.time)[0],
-            endTime: unref(it.editValueRefs.time)[1],
-          };
-        }),
+        data: newNoTeachingDay,
       }),
       }),
       teachingDay: JSON.stringify({
       teachingDay: JSON.stringify({
-        data: form.teachingDay.map((it) => {
-          return {
-            ticketNum: unref(it.editValueRefs.ticketNum),
-            startTime: unref(it.editValueRefs.time)[0],
-            endTime: unref(it.editValueRefs.time)[1],
-          };
-        }),
+        data: newTeachingDay,
       }),
       }),
     };
     };
-    // console.log(form);
+    console.log(newObj, 'newObj');
     try {
     try {
       await saveOrUpdate(newObj);
       await saveOrUpdate(newObj);
       isSubmit.value = false;
       isSubmit.value = false;
@@ -117,6 +129,7 @@
   }
   }
 
 
   const qrcodeCanvasRef = ref();
   const qrcodeCanvasRef = ref();
+
   async function downloadImage() {
   async function downloadImage() {
     const url = await qrcodeCanvasRef.value.toDataURL();
     const url = await qrcodeCanvasRef.value.toDataURL();
     const a = document.createElement('a');
     const a = document.createElement('a');
@@ -151,14 +164,15 @@
     }
     }
   }
   }
 
 
-  const siteId=ref()
+  const siteId = ref();
+
   function handleCommonSet(res) {
   function handleCommonSet(res) {
     // console.log( res,'获取数据')
     // console.log( res,'获取数据')
-    siteId.value=res.siteId
-    console.log( `https://api.qlapp.cn/school/?placeId=${siteId.value}`,'获取到的siteid')
+    siteId.value = res.siteId;
+    console.log(`https://api.qlapp.cn/school/?placeId=${siteId.value}`, '获取到的siteid');
     setFieldsValue({
     setFieldsValue({
       ...res,
       ...res,
-      insureIds: res.insureIds.split(','),
+      insureIds: res.insureIds ? res.insureIds.split(',') : '',
       noTeachingDay: res.noTeachingDay
       noTeachingDay: res.noTeachingDay
         ? JSON.parse(res.noTeachingDay).data.map((it) => {
         ? JSON.parse(res.noTeachingDay).data.map((it) => {
             return { ...it, time: [it.startTime, it.endTime] };
             return { ...it, time: [it.startTime, it.endTime] };

+ 1 - 0
src/views/businessManagement/schoolOpen/schoolOpen.data.ts

@@ -169,6 +169,7 @@ export const ScheduleArrangementColums: BasicColumn[] = [
     editComponentProps: {
     editComponentProps: {
       size: 'middle',
       size: 'middle',
       disabled: !getIsMerchant.value,
       disabled: !getIsMerchant.value,
+      min:1,
     },
     },
     editRow: true,
     editRow: true,
     editable: true,
     editable: true,