mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
讲师管理bug
This commit is contained in:
@@ -155,8 +155,8 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="初始授课时长" name="teaching">
|
||||
<a-input v-model:value="formParam.teaching" style="width:100%; height: 40px; border-radius: 8px ; "
|
||||
<a-form-item label="初始授课时长" name="defaultTeachingTime">
|
||||
<a-input v-model:value="formParam.defaultTeachingTime" style="width:100%; height: 40px; border-radius: 8px ; "
|
||||
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber" @focus="focusTeaching">
|
||||
</a-input>
|
||||
<!-- <span style="margin-left: 5px ;" v-if="formParam.teaching !== null">{{ (formParam.teaching / 60
|
||||
@@ -350,7 +350,7 @@ export default {
|
||||
teacherType:'2',
|
||||
photo:null,
|
||||
status:1,
|
||||
teaching:0,
|
||||
defaultTeachingTime:0,
|
||||
},
|
||||
vf:true,
|
||||
searchParam: {
|
||||
@@ -564,6 +564,9 @@ export default {
|
||||
//保存
|
||||
const createTeacherDialog = async () => {
|
||||
state.formParam.supplier = state.formParam?.supplier?.trim()
|
||||
if(state.formParam.defaultTeachingTime||state.formParam.defaultTeachingTime==0){
|
||||
state.formParam.defaultTeachingTime = String(state.formParam.defaultTeachingTime)
|
||||
}
|
||||
const formItemNames = Object.keys(rules);
|
||||
for(let i=0;i<formItemNames.length;i++){
|
||||
// const result = await validateField(formItemNames[i]);
|
||||
@@ -684,7 +687,7 @@ export default {
|
||||
status:1,
|
||||
teacherType:2,
|
||||
photo:null,
|
||||
teaching:0,
|
||||
defaultTeachingTime:0,
|
||||
name: null,
|
||||
mobile: null,
|
||||
email: null,
|
||||
@@ -699,6 +702,7 @@ export default {
|
||||
const rules = {
|
||||
name: [{ required: true, message: '',log: '讲师不能为空' }],
|
||||
supplier:[{ required: true, message: '',log:'供应商不能为空' }],
|
||||
defaultTeachingTime:[{ required: true, message: '',log:'初始授课时长不能为空' }],
|
||||
// email:[
|
||||
// {
|
||||
// type: "email",
|
||||
@@ -786,12 +790,12 @@ export default {
|
||||
}
|
||||
}
|
||||
const clearNonNumber = () => {
|
||||
state.formParam.teaching = state.formParam.teaching?.replace(/\D/g, '');
|
||||
state.formParam.teaching = state.formParam.teaching?.slice(0,8)
|
||||
!state.formParam.teaching && (state.formParam.teaching = 0)
|
||||
state.formParam.defaultTeachingTime = state.formParam.defaultTeachingTime?.replace(/\D/g, '');
|
||||
state.formParam.defaultTeachingTime = state.formParam.defaultTeachingTime?.slice(0,8)
|
||||
!state.formParam.defaultTeachingTime && (state.formParam.defaultTeachingTime = 0)
|
||||
}
|
||||
const focusTeaching = () => {
|
||||
state.formParam.teaching == 0 && (state.formParam.teaching = null)
|
||||
state.formParam.defaultTeachingTime == 0 && (state.formParam.defaultTeachingTime = null)
|
||||
}
|
||||
const sendRemark=()=>{
|
||||
state.formParam.remark = state.formParam.remark?.replace(/\s/g, '');
|
||||
|
||||
Reference in New Issue
Block a user