|
@@ -27,7 +27,7 @@
|
|
|
</div>
|
|
|
<div class="check-in-item" >
|
|
|
<div class="check-in-item-title" >培训性质</div>
|
|
|
- <div class="check-in-item-input" @click="openModal('nature')">
|
|
|
+ <div :class="['check-in-item-input', formRequireState.natureId ? 'check-in-item-input-warn' : '']" @click="openModal('nature')">
|
|
|
<div class="placeholder" v-if="!formSate.natureId" >请选择</div>
|
|
|
<div class="check-in-item-value" v-else >{{formSate.nature}}</div>
|
|
|
<van-icon name="arrow-down" />
|
|
@@ -35,7 +35,7 @@
|
|
|
</div>
|
|
|
<div class="check-in-item" >
|
|
|
<div class="check-in-item-title" >培训形式</div>
|
|
|
- <div class="check-in-item-input" @click="openModal('method')">
|
|
|
+ <div :class="['check-in-item-input', formRequireState.methodId ? 'check-in-item-input-warn' : '']" @click="openModal('method')">
|
|
|
<div class="placeholder" v-if="!formSate.methodId" >请选择</div>
|
|
|
<div class="check-in-item-value" v-else >{{formSate.method}}</div>
|
|
|
<van-icon name="arrow-down" />
|
|
@@ -43,11 +43,17 @@
|
|
|
</div>
|
|
|
<div class="check-in-item" >
|
|
|
<div class="check-in-item-title" >培训内容</div>
|
|
|
- <div :class="['check-in-item-input',formRequireState.contentId ? 'check-in-item-input-warn' : '' ]" @click="openModal('content')">
|
|
|
+ <van-checkbox-group class="check-in-item-content" v-model="formSate.contents" direction="horizontal" shape="square">
|
|
|
+ <van-checkbox :name="item.name" style="margin-bottom: 12px" v-for="item in contentList" :key="item.id" >{{item.name}}</van-checkbox>
|
|
|
+ <van-checkbox :name="formSate.cusContent" style="margin-bottom: 12px" >
|
|
|
+ <van-field style="border: 1px solid #cdc8c8;height: 40px;" v-model="formSate.cusContent" label="" placeholder="自定义培训内容" />
|
|
|
+ </van-checkbox>
|
|
|
+ </van-checkbox-group>
|
|
|
+ <!-- <div :class="['check-in-item-input',formRequireState.contentId ? 'check-in-item-input-warn' : '' ]" @click="openModal('content')">
|
|
|
<div class="placeholder" v-if="!formSate.content" >请选择</div>
|
|
|
<div :class="['check-in-item-value' ]" v-else >{{formSate.content}}</div>
|
|
|
<van-icon name="arrow-down" />
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
<div class="check-in-item" >
|
|
|
<div class="check-in-item-title" >培训科目</div>
|
|
@@ -94,7 +100,7 @@
|
|
|
<div class="info-modal-item" > <div class="title"> 培训性质 </div> <div class="value"> {{formSate.nature}} </div></div>
|
|
|
<div class="info-modal-item" > <div class="title"> 培训形式 </div> <div class="value"> {{formSate.method}} </div></div>
|
|
|
<div class="info-modal-item" > <div class="title"> 培训形态 </div> <div class="value"> {{formSate.form}} </div></div>
|
|
|
- <div class="info-modal-item" > <div class="title"> 培训内容 </div> <div class="value"> {{formSate.content}} </div></div>
|
|
|
+ <div class="info-modal-item" > <div class="title"> 培训内容 </div> <div class="value"> {{formSate.contents.join('/')}} </div></div>
|
|
|
<div class="info-modal-item" > <div class="title"> 园所名称 </div> <div class="value"> {{formSate.schoolName}} </div></div>
|
|
|
<div class="info-modal-item" > <div class="title"> 代理商名称 </div> <div class="value"> {{formSate.agentName}} </div></div>
|
|
|
</div>
|
|
@@ -104,7 +110,7 @@
|
|
|
|
|
|
</template>
|
|
|
<script setup >
|
|
|
-import { ref, computed, onMounted } from 'vue'
|
|
|
+import { ref, computed, onMounted, watch } from 'vue'
|
|
|
import CityJson from '@/json/city.json'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useUserStore, useCommonStore, useTrainStore } from '@/store'
|
|
@@ -128,25 +134,26 @@ const formSate = ref({
|
|
|
subject: '',
|
|
|
subjectId: '',
|
|
|
teacherId: '',
|
|
|
- content: '',
|
|
|
- contentId: '',
|
|
|
+ contents: [],
|
|
|
address: '',
|
|
|
schoolName: '',
|
|
|
agentName: '',
|
|
|
- methodId: 1,
|
|
|
- method: '线上',
|
|
|
- natureId: 1,
|
|
|
- nature: '推广',
|
|
|
- regions: []
|
|
|
+ methodId: '',
|
|
|
+ method: '',
|
|
|
+ natureId: '',
|
|
|
+ nature: '',
|
|
|
+ regions: [],
|
|
|
+ cusContent: ''
|
|
|
})
|
|
|
|
|
|
const formRequireState = ref({
|
|
|
formId: false,
|
|
|
subjectId: false,
|
|
|
- contentId: false,
|
|
|
regions: false,
|
|
|
schoolName: false,
|
|
|
- agentName: false
|
|
|
+ agentName: false,
|
|
|
+ methodId: false,
|
|
|
+ natureId: false
|
|
|
})
|
|
|
|
|
|
const fieldNames = {
|
|
@@ -155,9 +162,9 @@ const fieldNames = {
|
|
|
children: 'children'
|
|
|
}
|
|
|
|
|
|
-const methods = ref([{id: 1, name: '线上'}, {id: 2, name: '本地'}, {id: 3, name: '外出'}])
|
|
|
+const methods = ref([{ id: 1, name: '线上' }, { id: 2, name: '本地' }, { id: 3, name: '外出' }])
|
|
|
|
|
|
-const natures = ref([{id: 1, name: '推广'}, {id: 2, name: '售后'}])
|
|
|
+const natures = ref([{ id: 1, name: '推广' }, { id: 2, name: '售后' }])
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
@@ -186,6 +193,13 @@ const sheetAction = computed(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+watch(
|
|
|
+ () => formSate.value.content,
|
|
|
+ () => {
|
|
|
+ console.log(formSate.value.content)
|
|
|
+ }
|
|
|
+)
|
|
|
+
|
|
|
const submit = () => {
|
|
|
trainStore.add(formSate.value).then(() => {
|
|
|
router.push({
|
|
@@ -235,7 +249,7 @@ const onFinish = (record) => {
|
|
|
console.log('record.selectedOptions:', formSate.value.regions)
|
|
|
}
|
|
|
|
|
|
-const { run } = useDebounceFn(() => submit(), {wait: 1000})
|
|
|
+const { run } = useDebounceFn(() => submit(), { wait: 1000 })
|
|
|
|
|
|
onMounted(() => {
|
|
|
getSubjectList()
|
|
@@ -267,6 +281,9 @@ onMounted(() => {
|
|
|
font-weight: 600;
|
|
|
text-align: left;
|
|
|
}
|
|
|
+ .check-in-item-content {
|
|
|
+ margin: 24px 0;
|
|
|
+ }
|
|
|
.check-in-disabled {
|
|
|
background-color: #ccc;
|
|
|
}
|