祖安之光
2025-11-18 00bae2110315cf9c9a533afea2c617d950f6768e
src/views/build/conpanyFunctionConsult/standardSysTemp/techStandardModule/components/editDialog.vue
@@ -33,6 +33,17 @@
        <el-form-item label="模板名称:" prop="templateName">
          <el-input v-model.trim="state.form.templateName" :disabled="state.title =='查看'" placeholder="模板名称"></el-input>
        </el-form-item>
        <el-form-item label="行业类别:" prop="industryTypeId">
          <el-select v-model="state.form.industryTypeId" filterable placeholder="请选择" clearable>
            <el-option
                v-for="item in state.typeList"
                :key="item.id"
                style="width: 100%"
                :label="item.name"
                :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="模板文件:" prop="filePath">
          <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>
@@ -81,6 +92,8 @@
    filePath: '',
    format: '',
    companyId: null,
    industryTypeId: null,
    industryTypeName: '',
    deptId:null,
    templateType: 2
  },
@@ -89,6 +102,7 @@
    templateName: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
    filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }],
    deptId: [{ required: true, message: '请选择部门', trigger: 'blur' }],
    industryTypeId: [{ required: true, message: '请选择行业类别', trigger: 'blur' }]
  },
  isAdmin: false,
  companyList: [],
@@ -98,17 +112,19 @@
  },
  fileLimit: 1,
  fileList: [],
  deptList: []
  deptList: [],
  typeList: []
})
onMounted(() => {
});
const openDialog = async (type, value,companyId, isAdmin, companyList) => {
const openDialog = async (type, value,companyId, isAdmin, companyList,typeList) => {
  state.isAdmin = isAdmin
  if(isAdmin){
    state.companyList = companyList
  }
  state.typeList = typeList
  state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看'
  state.form.companyId = companyId
  if(state.title == '编辑'||state.title == '查看'){
@@ -146,6 +162,7 @@
const onSubmit = async () => {
  const valid = await superRef.value.validate();
  if(valid){
    state.form.industryTypeName = state.typeList.find(i=>i.id == state.form.industryTypeId)?.name || ''
    if(state.title == '新增'){
      const {id,...data} = state.form
      const res = await saveStandardTemp(data)
@@ -227,6 +244,8 @@
    filePath: '',
    format: '',
    companyId: null,
    industryTypeId: null,
    industryTypeName: '',
    deptId:null,
    templateType: 2
  }