|
@@ -191,7 +191,7 @@ async function insertResume() {
|
|
|
|
|
|
// try {
|
|
|
// const response = await axios.post(
|
|
|
-// `https://cmm.ai:8088/api/input_user_resume?access_token=${token}&old_file=${oldFile}`,
|
|
|
+// `${store.apiUrl}/api/input_user_resume?access_token=${token}&old_file=${oldFile}`,
|
|
|
// formData
|
|
|
// );
|
|
|
// console.log("新增履歷 response", response);
|
|
@@ -257,12 +257,18 @@ async function insertClassName() {
|
|
|
|
|
|
try {
|
|
|
const response = await axios.post(
|
|
|
- "https://cmm.ai:8088/api/insert_class_name",
|
|
|
+ `${store.apiUrl}/api/insert_class_name`,
|
|
|
formData
|
|
|
);
|
|
|
|
|
|
console.log("新增課程 response", response);
|
|
|
- classNameId.value = response.data.new_class_name_id;
|
|
|
+
|
|
|
+ if (response.data.code === 200) {
|
|
|
+ classNameId.value = response.data.new_class_name_id;
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // classNameId.value = response.data.new_class_name_id;
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
}
|
|
@@ -286,6 +292,7 @@ let event = reactive({
|
|
|
registration_start: "", // 報名起始日
|
|
|
registration_end: "", // 報名截止日
|
|
|
number_limit: "", // 課程名額
|
|
|
+ number_minimum: "", // 最低開課人數
|
|
|
remark: "", // 備註
|
|
|
ATM_address: "", // 匯款帳號(銀行代碼+帳號)
|
|
|
access_token: token,
|
|
@@ -353,7 +360,7 @@ function addEventData() {
|
|
|
if (
|
|
|
event.event === "" || // 場次名稱
|
|
|
event.contact === "" || // 聯絡資訊
|
|
|
- event.lecturer === "" || // 課程講師
|
|
|
+ // event.lecturer === "" || // 課程講師
|
|
|
event.people === "" || // 對象
|
|
|
event.fee_method === "" || // 課程價格
|
|
|
event.fee_payment === "" || // 收費方式
|
|
@@ -365,9 +372,12 @@ function addEventData() {
|
|
|
eventFieldValidate.value = true;
|
|
|
}
|
|
|
|
|
|
- // event.location = location.address;
|
|
|
- // console.log("location.address", location.address);
|
|
|
- console.log("event.location", event.location);
|
|
|
+ // 帶入指派講師姓名
|
|
|
+ event.lecturer = assignTeachers.list
|
|
|
+ .map((item) => item.teacher_name)
|
|
|
+ .join("、");
|
|
|
+
|
|
|
+ console.log("event", event);
|
|
|
|
|
|
// 處理時間格式
|
|
|
event.start_time = store.mergeAndFormatDateTime(
|
|
@@ -406,12 +416,12 @@ async function insertEvent() {
|
|
|
event.name_id = classNameId.value;
|
|
|
}
|
|
|
|
|
|
- event.start_time = convertDateFormat(event.start_time);
|
|
|
- event.end_time = convertDateFormat(event.end_time);
|
|
|
- event.registration_start = convertDateFormat(event.registration_start);
|
|
|
- event.registration_end = convertDateFormat(event.registration_end);
|
|
|
+ // event.start_time = convertDateFormat(event.start_time);
|
|
|
+ // event.end_time = convertDateFormat(event.end_time);
|
|
|
+ // event.registration_start = convertDateFormat(event.registration_start);
|
|
|
+ // event.registration_end = convertDateFormat(event.registration_end);
|
|
|
|
|
|
- console.log("檢查日期格式", event);
|
|
|
+ // console.log("檢查日期格式", event);
|
|
|
|
|
|
const formData = new FormData();
|
|
|
for (const key in event) {
|
|
@@ -420,12 +430,16 @@ async function insertEvent() {
|
|
|
|
|
|
try {
|
|
|
const response = await axios.post(
|
|
|
- "https://cmm.ai:8088/api/insert_event",
|
|
|
+ `${store.apiUrl}/api/insert_event`,
|
|
|
formData
|
|
|
);
|
|
|
eventId.value = response.data.class_id;
|
|
|
console.log("eventId.value", eventId.value);
|
|
|
console.log("新增場次 response", response);
|
|
|
+
|
|
|
+ if (response.data.code !== 200) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
} catch (error) {
|
|
|
console.error(error);
|
|
|
}
|
|
@@ -652,7 +666,7 @@ async function insertSession() {
|
|
|
|
|
|
// 一日課程
|
|
|
const response = await axios.post(
|
|
|
- "https://cmm.ai:8088/api/insert_session",
|
|
|
+ `${store.apiUrl}/api/insert_session`,
|
|
|
oneDayFormData
|
|
|
);
|
|
|
console.log("新增課堂(一日) response", response);
|
|
@@ -664,7 +678,7 @@ async function insertSession() {
|
|
|
|
|
|
// 週期課程
|
|
|
const response = await axios.post(
|
|
|
- "https://cmm.ai:8088/api/auto_create_session",
|
|
|
+ `${store.apiUrl}/api/auto_create_session`,
|
|
|
formData
|
|
|
);
|
|
|
console.log("新增課堂(週期) response", response);
|
|
@@ -690,7 +704,7 @@ let schoolId = ref("");
|
|
|
let token = store.token;
|
|
|
try {
|
|
|
const response = await axios.get(
|
|
|
- `https://cmm.ai:8088/api/get_school?&access_token=${token}`
|
|
|
+ `${store.apiUrl}/api/get_school?&access_token=${token}`
|
|
|
);
|
|
|
|
|
|
schoolSelect.list = response.data.schools;
|
|
@@ -718,7 +732,7 @@ async function handleSchoolData(id) {
|
|
|
console.log("handleSchoolData", id);
|
|
|
try {
|
|
|
const response = await axios.get(
|
|
|
- `https://cmm.ai:8088/api/get_school?location_id=${id}`
|
|
|
+ `${store.apiUrl}/api/get_school?location_id=${id}`
|
|
|
);
|
|
|
|
|
|
schools.list = response.data.schools;
|
|
@@ -805,7 +819,7 @@ async function getSchool(id) {
|
|
|
|
|
|
try {
|
|
|
const response = await axios.get(
|
|
|
- `https://cmm.ai:8088/api/get_school?location_id=${id}`
|
|
|
+ `${store.apiUrl}/api/get_school?location_id=${id}`
|
|
|
);
|
|
|
|
|
|
console.log("取得據點", response);
|
|
@@ -1682,11 +1696,12 @@ async function assignTeacher(item, index) {
|
|
|
</v-label>
|
|
|
</v-col>
|
|
|
|
|
|
- <v-col cols="12" sm="6" class="py-0">
|
|
|
+ <!-- <v-col cols="12" sm="6" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
|
<p class="pb-5 pe-3">
|
|
|
課程講師<span class="mark">*</span>
|
|
|
</p>
|
|
|
+
|
|
|
<v-text-field
|
|
|
v-model="event.lecturer"
|
|
|
:rules="[requiredRule]"
|
|
@@ -1694,7 +1709,7 @@ async function assignTeacher(item, index) {
|
|
|
variant="outlined"
|
|
|
></v-text-field>
|
|
|
</v-label>
|
|
|
- </v-col>
|
|
|
+ </v-col> -->
|
|
|
|
|
|
<v-col cols="12" sm="6" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
@@ -1712,11 +1727,16 @@ async function assignTeacher(item, index) {
|
|
|
|
|
|
<v-col cols="12" sm="6" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
|
- <p class="pb-5 pe-3">課程教室</p>
|
|
|
+ <p class="pb-5 pe-3">
|
|
|
+ 課程名額<span class="mark">*</span>
|
|
|
+ </p>
|
|
|
<v-text-field
|
|
|
- v-model="event.location"
|
|
|
+ v-model="event.number_limit"
|
|
|
+ :rules="[requiredRule]"
|
|
|
density="compact"
|
|
|
variant="outlined"
|
|
|
+ type="number"
|
|
|
+ placeholder="請設定報名人數上限"
|
|
|
></v-text-field>
|
|
|
</v-label>
|
|
|
</v-col>
|
|
@@ -1724,15 +1744,27 @@ async function assignTeacher(item, index) {
|
|
|
<v-col cols="12" sm="6" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
|
<p class="pb-5 pe-3">
|
|
|
- 課程名額<span class="mark">*</span>
|
|
|
+ 最低開課人數<span class="mark"
|
|
|
+ >*</span
|
|
|
+ >
|
|
|
</p>
|
|
|
<v-text-field
|
|
|
- v-model="event.number_limit"
|
|
|
- :rules="[requiredRule]"
|
|
|
+ v-model="event.number_minimum"
|
|
|
density="compact"
|
|
|
variant="outlined"
|
|
|
type="number"
|
|
|
- placeholder="請設定報名人數上限"
|
|
|
+ placeholder="請輸入開課門檻人數"
|
|
|
+ ></v-text-field>
|
|
|
+ </v-label>
|
|
|
+ </v-col>
|
|
|
+
|
|
|
+ <v-col cols="12" sm="6" class="py-0">
|
|
|
+ <v-label class="d-flex align-center py-2">
|
|
|
+ <p class="pb-5 pe-5">課程教室</p>
|
|
|
+ <v-text-field
|
|
|
+ v-model="event.location"
|
|
|
+ density="compact"
|
|
|
+ variant="outlined"
|
|
|
></v-text-field>
|
|
|
</v-label>
|
|
|
</v-col>
|
|
@@ -1740,15 +1772,14 @@ async function assignTeacher(item, index) {
|
|
|
<v-col cols="12" sm="6" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
|
<p class="pb-5 pe-3">
|
|
|
- 最低開課人數<span class="mark"
|
|
|
- >*</span
|
|
|
- >
|
|
|
+ 課程價格<span class="mark">*</span>
|
|
|
</p>
|
|
|
<v-text-field
|
|
|
+ v-model="event.fee_method"
|
|
|
+ :rules="[requiredRule]"
|
|
|
density="compact"
|
|
|
variant="outlined"
|
|
|
type="number"
|
|
|
- placeholder="請輸入開課門檻人數"
|
|
|
></v-text-field>
|
|
|
</v-label>
|
|
|
</v-col>
|
|
@@ -1801,7 +1832,7 @@ async function assignTeacher(item, index) {
|
|
|
</v-label>
|
|
|
</v-col>
|
|
|
|
|
|
- <v-col cols="12" class="py-0">
|
|
|
+ <!-- <v-col cols="12" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
|
<p class="pb-5 pe-3">
|
|
|
課程價格<span class="mark">*</span>
|
|
@@ -1814,7 +1845,7 @@ async function assignTeacher(item, index) {
|
|
|
type="number"
|
|
|
></v-text-field>
|
|
|
</v-label>
|
|
|
- </v-col>
|
|
|
+ </v-col> -->
|
|
|
|
|
|
<v-col cols="12" class="py-0">
|
|
|
<v-label class="d-flex align-center py-2">
|
|
@@ -2113,9 +2144,7 @@ async function assignTeacher(item, index) {
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>名稱</th>
|
|
|
- <th>日期</th>
|
|
|
- <th width="20%">課程講師</th>
|
|
|
- <th width="20%">收費方式</th>
|
|
|
+ <th></th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
@@ -2125,22 +2154,142 @@ async function assignTeacher(item, index) {
|
|
|
>
|
|
|
<td>{{ item.event }}</td>
|
|
|
<td>
|
|
|
- {{
|
|
|
- moment(`${item.start_time}`).format(
|
|
|
- "YYYY/MM/DD"
|
|
|
- )
|
|
|
- }}
|
|
|
- <br />
|
|
|
- ~
|
|
|
- <br />
|
|
|
- {{
|
|
|
- moment(`${item.end_time}`).format(
|
|
|
- "YYYY/MM/DD"
|
|
|
- )
|
|
|
- }}
|
|
|
+ <v-dialog width="auto">
|
|
|
+ <template v-slot:activator="{ props }">
|
|
|
+ <v-btn
|
|
|
+ v-bind="props"
|
|
|
+ text="查看"
|
|
|
+ variant="tonal"
|
|
|
+ color="purple"
|
|
|
+ rounded="xl"
|
|
|
+ >
|
|
|
+ </v-btn>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:default="{ isActive }">
|
|
|
+ <v-card
|
|
|
+ :title="`場次:${item.event}`"
|
|
|
+ class="pa-3"
|
|
|
+ >
|
|
|
+ <v-card-text
|
|
|
+ style="
|
|
|
+ letter-spacing: 1px;
|
|
|
+ line-height: 1.5;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- {{ item.introduction }} -->
|
|
|
+ <table class="mt-5 event-table">
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <td>場次日期</td>
|
|
|
+ <td>
|
|
|
+ {{
|
|
|
+ item.start_time.split(
|
|
|
+ "T"
|
|
|
+ )[0]
|
|
|
+ }}
|
|
|
+ <span class="ps-1">{{
|
|
|
+ item.start_time
|
|
|
+ .split("T")[1]
|
|
|
+ .substring(0, 5)
|
|
|
+ }}</span>
|
|
|
+ <span class="ms-2 me-1"
|
|
|
+ >~</span
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ item.end_time.split("T")[0]
|
|
|
+ }}
|
|
|
+ <span class="ps-1">{{
|
|
|
+ item.end_time
|
|
|
+ .split("T")[1]
|
|
|
+ .substring(0, 5)
|
|
|
+ }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>報名時間</td>
|
|
|
+ <td>
|
|
|
+ {{
|
|
|
+ item.registration_start.split(
|
|
|
+ "T"
|
|
|
+ )[0]
|
|
|
+ }}
|
|
|
+ <span class="ps-1">{{
|
|
|
+ item.registration_start
|
|
|
+ .split("T")[1]
|
|
|
+ .substring(0, 5)
|
|
|
+ }}</span>
|
|
|
+ <span class="ms-2 me-1"
|
|
|
+ >~</span
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ item.registration_end.split(
|
|
|
+ "T"
|
|
|
+ )[0]
|
|
|
+ }}
|
|
|
+ <span class="ps-1">{{
|
|
|
+ item.registration_end
|
|
|
+ .split("T")[1]
|
|
|
+ .substring(0, 5)
|
|
|
+ }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>課程名額</td>
|
|
|
+ <td>{{ item.number_limit }}</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>開課人數</td>
|
|
|
+ <td>
|
|
|
+ {{ item.number_minimum }}
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>課程價格</td>
|
|
|
+ <td>{{ item.fee_method }}</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>收費方式</td>
|
|
|
+ <td>{{ item.fee_payment }}</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr
|
|
|
+ v-if="item.ATM_address !== ''"
|
|
|
+ >
|
|
|
+ <td>匯款帳號</td>
|
|
|
+ <td>{{ item.ATM_address }}</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>聯絡資訊</td>
|
|
|
+ <td>{{ item.contact }}</td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
+ <td>適合對象</td>
|
|
|
+ <td>{{ item.people }}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </v-card-text>
|
|
|
+
|
|
|
+ <v-card-actions class="justify-end">
|
|
|
+ <v-spacer></v-spacer>
|
|
|
+
|
|
|
+ <v-btn
|
|
|
+ text="關閉"
|
|
|
+ @click="isActive.value = false"
|
|
|
+ ></v-btn>
|
|
|
+ </v-card-actions>
|
|
|
+ </v-card>
|
|
|
+ </template>
|
|
|
+ </v-dialog>
|
|
|
</td>
|
|
|
- <td>{{ item.lecturer }}</td>
|
|
|
- <td>{{ item.fee_method }}</td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
@@ -2474,7 +2623,7 @@ async function assignTeacher(item, index) {
|
|
|
</v-container>
|
|
|
</template>
|
|
|
|
|
|
-<style lang="scss">
|
|
|
+<style lang="scss" scoped>
|
|
|
.step-title {
|
|
|
text-align: center;
|
|
|
h5 {
|
|
@@ -2536,6 +2685,22 @@ async function assignTeacher(item, index) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.event-table {
|
|
|
+ &,
|
|
|
+ tr,
|
|
|
+ td {
|
|
|
+ padding: 10px 20px;
|
|
|
+ border: 1px solid #d7d7d7;
|
|
|
+ border-collapse: collapse;
|
|
|
+ }
|
|
|
+
|
|
|
+ tr {
|
|
|
+ td:first-child {
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.sessions-card {
|
|
|
border-radius: 1.875em 0.3125em 0.3125em 1.875em !important;
|
|
|
|
|
@@ -2570,6 +2735,7 @@ async function assignTeacher(item, index) {
|
|
|
.main-table {
|
|
|
margin: 3.125em 0;
|
|
|
.table-title {
|
|
|
+ width: auto !important;
|
|
|
background-color: var(--purple);
|
|
|
}
|
|
|
|