讲师管理bug

This commit is contained in:
zhangsir
2024-12-23 10:35:48 +08:00
parent e507bacddb
commit ed2cbf426c

View File

@@ -155,8 +155,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="初始授课时长" name="teaching"> <a-form-item label="初始授课时长" name="defaultTeachingTime">
<a-input v-model:value="formParam.teaching" style="width:100%; height: 40px; border-radius: 8px ; " <a-input v-model:value="formParam.defaultTeachingTime" style="width:100%; height: 40px; border-radius: 8px ; "
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber" @focus="focusTeaching"> placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber" @focus="focusTeaching">
</a-input> </a-input>
<!-- <span style="margin-left: 5px ;" v-if="formParam.teaching !== null">{{ (formParam.teaching / 60 <!-- <span style="margin-left: 5px ;" v-if="formParam.teaching !== null">{{ (formParam.teaching / 60
@@ -350,7 +350,7 @@ export default {
teacherType:'2', teacherType:'2',
photo:null, photo:null,
status:1, status:1,
teaching:0, defaultTeachingTime:0,
}, },
vf:true, vf:true,
searchParam: { searchParam: {
@@ -564,6 +564,9 @@ export default {
//保存 //保存
const createTeacherDialog = async () => { const createTeacherDialog = async () => {
state.formParam.supplier = state.formParam?.supplier?.trim() 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); const formItemNames = Object.keys(rules);
for(let i=0;i<formItemNames.length;i++){ for(let i=0;i<formItemNames.length;i++){
// const result = await validateField(formItemNames[i]); // const result = await validateField(formItemNames[i]);
@@ -684,7 +687,7 @@ export default {
status:1, status:1,
teacherType:2, teacherType:2,
photo:null, photo:null,
teaching:0, defaultTeachingTime:0,
name: null, name: null,
mobile: null, mobile: null,
email: null, email: null,
@@ -699,6 +702,7 @@ export default {
const rules = { const rules = {
name: [{ required: true, message: '',log: '讲师不能为空' }], name: [{ required: true, message: '',log: '讲师不能为空' }],
supplier:[{ required: true, message: '',log:'供应商不能为空' }], supplier:[{ required: true, message: '',log:'供应商不能为空' }],
defaultTeachingTime:[{ required: true, message: '',log:'初始授课时长不能为空' }],
// email:[ // email:[
// { // {
// type: "email", // type: "email",
@@ -786,12 +790,12 @@ export default {
} }
} }
const clearNonNumber = () => { const clearNonNumber = () => {
state.formParam.teaching = state.formParam.teaching?.replace(/\D/g, ''); state.formParam.defaultTeachingTime = state.formParam.defaultTeachingTime?.replace(/\D/g, '');
state.formParam.teaching = state.formParam.teaching?.slice(0,8) state.formParam.defaultTeachingTime = state.formParam.defaultTeachingTime?.slice(0,8)
!state.formParam.teaching && (state.formParam.teaching = 0) !state.formParam.defaultTeachingTime && (state.formParam.defaultTeachingTime = 0)
} }
const focusTeaching = () => { const focusTeaching = () => {
state.formParam.teaching == 0 && (state.formParam.teaching = null) state.formParam.defaultTeachingTime == 0 && (state.formParam.defaultTeachingTime = null)
} }
const sendRemark=()=>{ const sendRemark=()=>{
state.formParam.remark = state.formParam.remark?.replace(/\s/g, ''); state.formParam.remark = state.formParam.remark?.replace(/\s/g, '');