| | |
| | | <el-input v-model.trim="state.form.templateName" :disabled="state.title =='查看'" placeholder="模板名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="行业:" prop="industryType"> |
| | | <el-select v-model="state.form.industryId" placeholder="请选择" clearable style="width: 100%"> |
| | | <el-select v-model="state.form.industryType" placeholder="请选择" clearable style="width: 100%"> |
| | | <el-option |
| | | v-for="item in state.industryList" |
| | | :key="item.id" |
| | |
| | | import {addIndustryTemp, updateIndustryTemp, updateInfoPlatforms} from "@/api/staffManage/staff"; |
| | | import {getToken} from "@/utils/auth"; |
| | | import {delPic} from "@/api/onlineEducation/banner"; |
| | | import {getIndustry} from "@/api/system/industry"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | |
| | | form: { |
| | | id: null, |
| | | templateName: '', |
| | | industryId: '', |
| | | industryType: '', |
| | | filePath: '', |
| | | fileName: '', |
| | | format: '', |
| | | companyId: null |
| | | }, |
| | | formRules:{ |
| | | companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }], |
| | | templateName: [{ required: true, message: '请输入模板名称', trigger: 'blur' }], |
| | | industryId: [{ required: true, message: '请选择行业类型', trigger: 'blur' }], |
| | | industryType: [{ required: true, message: '请选择行业类型', trigger: 'blur' }], |
| | | filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }] |
| | | }, |
| | | isAdmin: false, |
| | |
| | | } |
| | | state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' |
| | | state.form.companyId = companyId |
| | | await getIndustryList() |
| | | if(state.title == '编辑'||state.title == '查看'){ |
| | | Object.keys(state.form).forEach(key => { |
| | | if (key in value) { |
| | |
| | | if(value.filePath) { |
| | | const obj = { |
| | | url: value.filePath, |
| | | name: '模板文件' |
| | | name: value.fileName |
| | | } |
| | | state.fileList = [obj] |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | const getIndustryList = async () => { |
| | | const res = await getIndustry() |
| | | if(res.code == 200){ |
| | | state.industryList = res.data.data |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const onSubmit = async () => { |
| | | const valid = await superRef.value.validate(); |
| | | if(valid){ |
| | |
| | | |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | if(res.code == 200){ |
| | | state.form.fileName = res.data.originName |
| | | state.form.filePath = res.data.path |
| | | state.form.format = '.' + res.data.filename.split('.')[1] |
| | | }else{ |
| | |
| | | // }) |
| | | state.form.filePath = '' |
| | | state.form.format = '' |
| | | state.form.fileName = '' |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | templateName: '', |
| | | industryType: '', |
| | | filePath: '', |
| | | fileName: '', |
| | | format: '', |
| | | companyId: null |
| | | } |