| | |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="150px" > |
| | | <el-form-item label="项目名称:" prop="itemId"> |
| | | <el-select v-model="state.form.itemId" |
| | | filterable |
| | | placeholder="请选择" |
| | | clearable style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in state.projectList" |
| | | :key="item.id" |
| | | :label="item.itemName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | |
| | | </el-form-item> |
| | | <el-form-item label="文件编号:" prop="number"> |
| | | <el-input v-model.trim="state.form.number" :disabled="state.title =='查看'" placeholder="文件编号"></el-input> |
| | | </el-form-item> |
| | |
| | | <el-upload accept=".doc,.docx" :action="state.uploadUrl" :headers="state.header" method="post" :on-success="(res, uploadFile)=>handleAvatarSuccess(res, uploadFile)" :on-exceed="showTip" :limit='state.fileLimit' v-model:file-list="state.fileList" :before-upload="picSize" :on-remove="(file, uploadFiles)=>handleRemove(file, uploadFiles)" > |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip">支持上传.doc、.docx格式文档,尺寸小于5M,最多可上传1张</div> |
| | | <div class="el-upload__tip">支持上传.doc、.docx格式文档,尺寸小于5M,最多可上传1份</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | |
| | | import {getToken} from "@/utils/auth"; |
| | | import {delPic} from "@/api/onlineEducation/banner"; |
| | | import {addFile, editFile} from "@/api/qualityManage/range"; |
| | | import {addProductFile, editProductFile} from "@/api/selfProblems/productFile"; |
| | | import {addProductFile, editProductFile, getProductSet} from "@/api/selfProblems/productFile"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | |
| | | companyId: null, |
| | | catalogueId: null, |
| | | erdact: '', |
| | | number: '' |
| | | number: '', |
| | | itemId: null |
| | | }, |
| | | formRules:{ |
| | | number: [{ required: true, message: '请输入材料编号', trigger: 'blur' }], |
| | | fileName: [{ required: true, message: '请输入材料名称', trigger: 'blur' }], |
| | | filePath: [{ required: true, message: '请上传文件', trigger: 'blur' }], |
| | | itemId: [{ required: true, message: '请选择项目', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | |
| | | Authorization: getToken() |
| | | }, |
| | | fileLimit: 1, |
| | | fileList: [] |
| | | fileList: [], |
| | | projectList: [], |
| | | userId: null, |
| | | }) |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | |
| | | const openDialog = async (type, value,companyId,catalogueId) => { |
| | | const openDialog = async (type, value,companyId,catalogueId,userId) => { |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | state.isAdmin = userInfo.userType === 0; |
| | | state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' |
| | | state.form.companyId = companyId |
| | | state.form.catalogueId = catalogueId |
| | | state.userId = userId |
| | | state.form.type = 2 |
| | | if(state.title == '编辑'||state.title == '查看'){ |
| | | Object.keys(state.form).forEach(key => { |
| | |
| | | } |
| | | state.fileList = [obj] |
| | | } |
| | | state.form.itemId = state.form.itemId == 0 ? null : state.form.itemId |
| | | } |
| | | await getProjectList() |
| | | dialogVisible.value = true |
| | | } |
| | | const getProjectList = async () => { |
| | | const param = { |
| | | companyId: state.form.companyId, |
| | | userId: state.isAdmin ? null : state.userId |
| | | } |
| | | const res = await getProductSet(param); |
| | | if(res.code === 200){ |
| | | state.projectList = res.data |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | |
| | | } |
| | | |
| | | const onSubmit = async () => { |
| | |
| | | companyId: null, |
| | | catalogueId: null, |
| | | erdact: '', |
| | | number: '' |
| | | number: '', |
| | | itemId: null |
| | | } |
| | | state.fileList = [] |
| | | superRef.value.clearValidate(); |