592c1750b148874737cdfba4b22b6229f9805fe6..1312eeb57ff234386b53d07869e844fe68afa482
2 天以前 祖安之光
修改新增
1312ee 对比 | 目录
2 天以前 zhouwx
模板导入
5b6c4c 对比 | 目录
2 天以前 祖安之光
修改新增
92ba37 对比 | 目录
已修改9个文件
已添加1个文件
224 ■■■■ 文件已修改
public/example.xls 补丁 | 查看 | 原始文档 | blame | 历史
public/qualityFile.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/api/staffManage/staff.js 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/industryTemplate/components/editDialog.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/industryTemplate/index.vue 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/qualityObjectives/table/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/example.xls
Binary files differ
public/qualityFile.docx
Binary files differ
src/api/staffManage/staff.js
@@ -71,6 +71,13 @@
        data: data
    })
}
export function uploadTemplate(data) {
    return request({
        url: '/company/industryTemplate/upload',
        method: 'post',
        data: data
    })
}
export function delSysClause(params) {
    return request({
@@ -110,4 +117,4 @@
        method: 'get',
        params: params
    })
}
}
src/views/build/conpanyFunctionConsult/digitalFileDep/manageType/qualityManual/index.vue
@@ -32,10 +32,10 @@
      <el-table-column label="序号" type="index" align="center" width="80"/>
      <el-table-column label="质量手册" prop="fileName" align="center">
        <template #default="scope">
          <el-button link type="primary" @click="initFile()">{{scope.row.companyName + scope.row.qualityName + '.docx'}}</el-button>
          <el-button link type="primary" @click="initFile(scope.row.companyName)">{{scope.row.companyName + scope.row.qualityName + '.docx'}}</el-button>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
<!--          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>-->
          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
@@ -241,19 +241,19 @@
  return tableData
}
const initFile = async () => {
const initFile = async (name) => {
  await getInfo()
  const templatePath = '/qualityFile.docx'
  try {
    await generateWordDocument(
        templatePath,
        data.companyInfo,
        '质量手册.docx'
        name+'质量手册.docx'
    );
    ElMessage.success('文档生成成功!');
    ElMessage.success('手册导出成功!');
  } catch (error) {
    console.error('导出失败:', error);
    ElMessage.warning('文档生成失败');
    ElMessage.warning('手册导出失败');
  }
}
src/views/build/conpanyFunctionConsult/industryTemplate/components/editDialog.vue
@@ -19,8 +19,14 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="模板名称:" prop="templateName">
          <el-input v-model.trim="state.form.templateName" :disabled="state.title =='查看'" placeholder="模板名称"></el-input>
        <el-form-item label="章节:" prop="chapter">
          <el-input v-model.trim="state.form.chapter" :disabled="state.title =='查看'" placeholder="章节"></el-input>
        </el-form-item>
        <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="type">
          <el-input v-model.trim="state.form.type" :disabled="state.title =='查看'" placeholder="分类"></el-input>
        </el-form-item>
        <el-form-item label="行业:" prop="industryType">
          <el-select v-model="state.form.industryType" placeholder="请选择" clearable style="width: 100%">
@@ -32,7 +38,7 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="模板文件:" prop="filePath">
        <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>
            <template #tip>
@@ -80,13 +86,17 @@
    filePath: '',
    fileName: '',
    format: '',
    companyId: null
    companyId: null,
    type: '',
    chapter: ''
  },
  formRules:{
    companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
    templateName: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
    templateName: [{ required: true, message: '请输入文件记录', trigger: 'blur' }],
    industryType: [{ required: true, message: '请选择行业类型', trigger: 'blur' }],
    filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }]
    filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }],
    chapter: [{ required: true, message: '请输入章节', trigger: 'blur' }],
    type: [{ required: true, message: '请输入分类', trigger: 'blur' }],
  },
  isAdmin: false,
  companyList: [],
@@ -223,7 +233,9 @@
    filePath: '',
    fileName: '',
    format: '',
    companyId: null
    companyId: null,
    type: '',
    chapter: ''
  }
  state.fileList = []
  superRef.value.clearValidate();
src/views/build/conpanyFunctionConsult/industryTemplate/index.vue
@@ -30,22 +30,29 @@
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="分类:" >
          <el-input v-model.trim="data.queryParams.type"  placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item >
          <el-button v-if="isAdmin" type="primary" @click="getList">查询</el-button>
          <el-button v-if="isAdmin" type="primary" plain @click="reset">重置</el-button>
          <el-button  type="primary" @click="getList">查询</el-button>
          <el-button  type="primary" plain @click="reset">重置</el-button>
          <el-button  type="primary"  @click="exportData">导入</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="dataList" :border="true">
      <el-table-column label="序号" type="index" align="center" width="80"/>
      <el-table-column label="模板名称" prop="templateName" align="center"/>
      <el-table-column label="章节" prop="chapter" align="center"/>
      <el-table-column label="文件记录" prop="templateName" align="center"/>
      <el-table-column label="行业" prop="industryName" align="center" />
      <el-table-column label="模板文件" prop="fileName" align="center">
      <el-table-column label="模板" prop="fileName" align="center">
        <template #default="scope">
          <el-link  style="" type="primary" @click="downloadFile(scope.row)">{{scope.row.fileName}}</el-link>
        </template>
      </el-table-column>
      <el-table-column label="分类" prop="type" align="center" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
        <template #default="scope">
          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
@@ -63,6 +70,39 @@
    />
    <edit-dialog ref="dialogRef" @getList=getList></edit-dialog>
    <el-dialog
        v-model="data.exportDialog"
        title="导入模板"
        width="550px"
        :before-close="handleCloseExport"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <el-form :model="state.form" size="default" ref="superRef" :rules="state.formRules" label-width="110px" >
        <el-form-item  label="表格模板:" >
            <el-button @click="downloadFileTable" size="default" :icon="Download" type="primary" plain>下载模板</el-button>
        </el-form-item>
        <el-form-item label="导入文件">
          <el-upload
              accept=".xlsx,.xls"
              :before-upload="beforeUpload"
              v-model:file-list="state.exportFileList"
              action="#"
              :auto-upload="false"
              :on-change="handleChange"
              style="width: 100%"
          >
            <el-button :icon="Upload" size="default" type="primary">点击上传</el-button>
          </el-upload>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="handleCloseExport" size="default">取 消</el-button>
          <el-button  type="primary" @click="onUpload" size="default">确定</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>
@@ -70,12 +110,13 @@
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {delCompany, getCompany} from "@/api/onlineEducation/company";
import { Plus, Upload, Download} from '@element-plus/icons-vue';
import {delUser, getUser} from "@/api/onlineEducation/user";
import Cookies from "js-cookie";
import editDialog from './components/editDialog.vue'
import {
  delIndustryTemp,
  getIndustryTemp,
  getIndustryTemp, uploadTemplate,
} from "@/api/staffManage/staff";
import useUserStore from "@/store/modules/user";
import axios from "axios";
@@ -85,20 +126,42 @@
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const checkFiles = (rule, value, callback) => {
  if (state.exportFileList.length == 0) {
    callback(new Error('请上传导入文件'))
  } else {
    callback()
  }
}
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    companyId: null,
    industryType: null
    industryType: null,
    type: ''
  },
  total: 0,
  dataList: [],
  companyList: [],
  industryList: [],
  isAdmin: false,
  typeList: []
  typeList: [],
  exportDialog: false,
});
const state = reactive({
  form: {
    id: null,
    filePath: '',
    companyId: null
  },
  formRules:{
    companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }],
    filePath: [{ required: true, validator: checkFiles, trigger: 'blur' }]
  },
  exportFileList: [],
})
const { queryParams, total, dataList,companyList,industryList, isAdmin } = toRefs(data);
const userInfo = ref()
@@ -123,7 +186,7 @@
  loading.value = true
  const res = await getIndustryTemp(data.queryParams)
  if(res.code == 200){
    data.dataList = res.data.list || []
    data.dataList = res.data.list
    data.total = res.data.total
  }else{
    ElMessage.warning(res.message)
@@ -177,15 +240,81 @@
  dialogRef.value.openDialog(type, value, data.queryParams.companyId, data.isAdmin, data.companyList);
}
const exportData = () => {
  data.exportDialog = true
}
const handleCloseExport = () => {
  state.exportFileList = []
  data.exportDialog = false
}
const beforeUpload = (file) => {
  state.exportFileList = [...state.exportFileList, file]
  state.exportFileList = state.exportFileList.slice(-1)
  return false;
}
const downloadFileTable = () => {
  const filePath = '/example.xls';
  const link = document.createElement('a');
  link.href = filePath;
  link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
  link.click();
}
const fileBinaryList = ref([])
const handleChange = (file, files) => {
  fileBinaryList.value = files;
};
const onUpload = async () => {
  if(state.exportFileList.length == 0){
    ElMessage({
      type: 'warning',
      message: '请先上传表格文件'
    });
    return
  }else{
    const formData = new FormData();
    fileBinaryList.value.forEach((file) => {
      formData.append('file', file.raw)
    })
    console.log('form',formData)
    const res = await uploadTemplate(formData)
    if(res.code == 200){
      ElMessage({
        type: 'success',
        message: '导入成功'
      });
      state.exportFileList = []
      data.exportDialog = false
      await getList()
    }else{
      ElMessage({
        type: 'error',
        message: res.message
      });
    }
  }
}
/** 重置新增的表单以及其他数据  */
const reset= async()=> {
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    companyId: null,
    industryType: null
  if(data.isAdmin){
    data.queryParams = {
      pageNum: 1,
      pageSize: 10,
      companyId: null,
      industryType: null,
      type: ''
    }
    await getCompanyList()
  }else {
    data.queryParams = {
      pageNum: 1,
      pageSize: 10,
      companyId: data.queryParams.companyId,
      industryType: null,
      type: ''
    }
  }
  await getCompanyList()
  await getList()
}
const handleDelete = (val) => {
@@ -208,4 +337,5 @@
      })
}
</script>
src/views/build/conpanyFunctionConsult/qualityObjectives/objective/index.vue
@@ -281,6 +281,7 @@
    }
    choosedData.value = []
    data.companyList = [];
    getCompanyList()
  }else {
    data.queryParams = {
      companyId: data.queryParams.companyId,
@@ -291,7 +292,7 @@
    }
  }
  getList();
  getCompanyList()
}
const exportData = () => {
  if(choosedData.value && choosedData.value.length === 0){
src/views/build/conpanyFunctionConsult/qualityObjectives/reportsituation/index.vue
@@ -339,6 +339,7 @@
    }
    choosedData.value = []
    data.companyList = [];
    getCompanyList()
  }else {
    data.queryParams = {
      companyId: data.queryParams.companyId,
@@ -349,7 +350,7 @@
    }
  }
  getList();
  getCompanyList()
}
const exportData = () => {
  if(choosedData.value && choosedData.value.length === 0){
src/views/build/conpanyFunctionConsult/qualityObjectives/table/index.vue
@@ -310,6 +310,7 @@
    }
    choosedData.value = []
    data.companyList = [];
    getCompanyList()
  }else {
    data.queryParams = {
      companyId: data.queryParams.companyId,
@@ -320,7 +321,7 @@
    }
  }
  getList();
  getCompanyList()
}
const exportData = () => {
  if(choosedData.value && choosedData.value.length === 0){
src/views/build/conpanyFunctionConsult/staffManage/staffRegister/index.vue
@@ -206,9 +206,13 @@
}
const getAllList = async () => {
  let params = data.queryParams
  params.pageSize = 999
  const res = await getUser(params)
  const res = await getUser({
    pageNum: 1,
    pageSize: 999,
    username: '',
    userType: null,
    companyId: null
  })
  if(res.code == 200){
    data.expertData = res.data.list.map((item,index) => {
      return {