| | |
| | | |
| | | export function getSupplierPage(params) { |
| | | return request({ |
| | | url: '/internal/audit/supplier/list', |
| | | url: '/supplier/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | |
| | | |
| | | export function addSupplier(data) { |
| | | return request({ |
| | | url: '/internal/audit/supplier/insert', |
| | | url: '/supplier/insert', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | |
| | | |
| | | export function editSupplier(params) { |
| | | return request({ |
| | | url: `/internal/audit/supplier/update`, |
| | | url: `/supplier/update`, |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | export function delSupplier(data) { |
| | | export function delSupplierById(data) { |
| | | return request({ |
| | | url: `/internal/audit/supplier/deleted?supplierId=${data}`, |
| | | url: `/supplier/deleted?supplierId=${data}`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | //业绩评定表 |
| | | export function getPerformance(params) { |
| | | return request({ |
| | | url: '/supplier/performance/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function editPerformance(params) { |
| | | return request({ |
| | | url: `/supplier/performance/update`, |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | //质量保证表 |
| | | export function getQuality(params) { |
| | | return request({ |
| | | url: '/supplier/quality/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function editQuality(params) { |
| | | return request({ |
| | | url: `/supplier/quality/update`, |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | //证书 |
| | | export function getSupplierCert(params) { |
| | | return request({ |
| | | url: '/supplier/certifity/list', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function addSupplierCert(data) { |
| | | return request({ |
| | | url: '/supplier/certifity/insert', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | export function editSupplierCert(params) { |
| | | return request({ |
| | | url: `/supplier/certifity/update`, |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | export function delSupplierCert(data) { |
| | | return request({ |
| | | url: `/supplier/certifity/deleted?certifityId=${data}`, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | |
| | | <el-form-item label="目录名称:" prop="mess"> |
| | | <el-input v-model.trim="state.form.mess" :disabled="state.title =='查看'" placeholder="目录名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="排序:" prop="sort"> |
| | | <el-input v-model.number.trim="state.form.sort" type="number" :disabled="state.title =='查看'" placeholder="排序"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer v-if="state.title !='查看'"> |
| | | <span class="dialog-footer"> |
| | |
| | | mess: '', |
| | | number:'', |
| | | parentId: null, |
| | | companyId: null |
| | | companyId: null, |
| | | sort: null |
| | | }, |
| | | formRules:{ |
| | | mess: [{ required: true, message: '请输入目录名称', trigger: 'blur' }], |
| | | number: [{ required: true, message: '请输入序号', trigger: 'blur' }], |
| | | parentId:[{ required: true, message: '请选择上级分支', trigger: 'blur' }], |
| | | sort: [{ required: true, message: '请输入排序', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | |
| | | mess: '', |
| | | number:'', |
| | | parentId: null, |
| | | companyId: null |
| | | companyId: null, |
| | | sort: null |
| | | } |
| | | state.isTree = false |
| | | superRef.value.clearValidate(); |
| | |
| | | {{scope.row.number}} {{scope.row.mess}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="排序" prop="sort" > |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('add',scope.row,2)">新增</el-button> |
| | |
| | | <el-form-item label="目录名称:" prop="mess"> |
| | | <el-input v-model.trim="state.form.mess" :disabled="state.title =='查看'" placeholder="目录名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="排序:" prop="sort"> |
| | | <el-input v-model.number.trim="state.form.sort" type="number" :disabled="state.title =='查看'" placeholder="排序"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer v-if="state.title !='查看'"> |
| | | <span class="dialog-footer"> |
| | |
| | | mess: '', |
| | | number:'', |
| | | parentId: null, |
| | | companyId: null |
| | | companyId: null, |
| | | sort: null |
| | | }, |
| | | formRules:{ |
| | | mess: [{ required: true, message: '请输入目录名称', trigger: 'blur' }], |
| | | number: [{ required: true, message: '请输入序号', trigger: 'blur' }], |
| | | parentId:[{ required: true, message: '请选择上级分支', trigger: 'blur' }], |
| | | sort: [{ required: true, message: '请输入排序', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | |
| | | mess: '', |
| | | number:'', |
| | | parentId: null, |
| | | companyId: null |
| | | companyId: null, |
| | | sort: null |
| | | } |
| | | state.isTree = false |
| | | superRef.value.clearValidate(); |
| | |
| | | {{scope.row.number}} {{scope.row.mess}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="排序" prop="sort" > |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('add',scope.row,2)">新增</el-button> |
| | |
| | | } |
| | | |
| | | const onSubmit = async () => { |
| | | if(state.isAdmin){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '管理员暂无权限' |
| | | }); |
| | | return; |
| | | } |
| | | // if(state.isAdmin){ |
| | | // ElMessage({ |
| | | // type: 'warning', |
| | | // message: '管理员暂无权限' |
| | | // }); |
| | | // return; |
| | | // } |
| | | const valid = await busRef.value.validate(); |
| | | if(valid){ |
| | | if(title.value === '新增'){ |
| | |
| | | </el-table-column> |
| | | <el-table-column label="手机号" prop="phone" align="center" width="130"/> |
| | | <el-table-column label="身份证" prop="idNo" align="center" width="200" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="创建人" prop="createBy" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.createUser.name}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="创建人" prop="createBy" align="center">--> |
| | | <!-- <template #default="scope">--> |
| | | <!-- <span>{{scope.row.createUser.name}}</span>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="工作岗位" prop="post" align="center"/> |
| | | <el-table-column label="职务" prop="duty" align="center"/> |
| | | <el-table-column label="一人一档" prop="duty" align="center" width="120"> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="notice"> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="证书列表" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :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="certifityName"> |
| | | <el-input v-model.trim="state.form.certifityName" :disabled="state.title =='查看'" placeholder="文件名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="文件:" prop="filePath"> |
| | | <el-upload accept=".jpg,.jpeg,.png,.doc,.docx,.pdf" :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">尺寸小于5M,最多可上传1份</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer v-if="state.title !='查看'"> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleClose" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmit" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import {addUser, editUser, getUserById, resetPwd} from "@/api/onlineEducation/user" |
| | | import {Base64} from "js-base64" |
| | | import {getCompany} from "@/api/onlineEducation/company"; |
| | | import {addIndustryTemp, updateIndustryTemp, updateInfoPlatforms} from "@/api/staffManage/staff"; |
| | | 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 {addSupplierCert, editSupplierCert} from "@/api/supplier/supplierList"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | | const superRef = ref() |
| | | const state = reactive({ |
| | | title: '', |
| | | form: { |
| | | id: null, |
| | | certifityName: '', |
| | | filePath: '', |
| | | supplierSureId: null, |
| | | }, |
| | | formRules:{ |
| | | certifityName: [{ required: true, message: '请输入证书名称', trigger: 'blur' }], |
| | | filePath: [{ required: true, message: '请上传文件', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | | industryList: [], |
| | | uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile', |
| | | header: { |
| | | Authorization: getToken() |
| | | }, |
| | | fileLimit: 1, |
| | | fileList: [] |
| | | }) |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | |
| | | const openDialog = async (type, value) => { |
| | | state.title = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ; |
| | | Object.keys(state.form).forEach(key => { |
| | | if (key in value) { |
| | | state.form[key] = value[key] |
| | | } |
| | | }) |
| | | if(value.filePath) { |
| | | const obj = { |
| | | url: value.filePath, |
| | | name: value.certifityName |
| | | } |
| | | state.fileList = [obj] |
| | | } |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | const onSubmit = async () => { |
| | | const valid = await superRef.value.validate(); |
| | | if(valid){ |
| | | if(state.title == '新增'){ |
| | | const {id,...data} = state.form |
| | | const res = await addSupplierCert(data) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.message) |
| | | emit('getList') |
| | | handleClose() |
| | | dialogVisible.value = false; |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }else{ |
| | | |
| | | const res = await editSupplierCert(state.form) |
| | | if(res.code == 200){ |
| | | ElMessage.success(res.message) |
| | | emit('getList') |
| | | handleClose() |
| | | dialogVisible.value = false; |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | const handleAvatarSuccess = (res, uploadFile) => { |
| | | if(res.code == 200){ |
| | | state.form.fileName = res.data.originName |
| | | state.form.filePath = res.data.path |
| | | }else{ |
| | | state.fileList = [] |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const showTip =()=>{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | } |
| | | const picSize = async (rawFile) => { |
| | | if(rawFile.size / 1024 / 1024 > 5){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件大小不能超过5M' |
| | | }); |
| | | return false |
| | | } |
| | | }; |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | let path = state.form.filePath; |
| | | await delPic({path: path}).then(res => { |
| | | if(res.code == 200){ |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | state.form.fileName = '' |
| | | state.form.filePath = '' |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | | state.form.fileName = '' |
| | | state.form.filePath = '' |
| | | }); |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | state.form = { |
| | | id: null, |
| | | certifityName: '', |
| | | filePath: '', |
| | | supplierSureId: null, |
| | | } |
| | | state.fileList = [] |
| | | superRef.value.clearValidate(); |
| | | superRef.value.resetFields() |
| | | dialogVisible.value = false; |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .notice{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | .file { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="notice"> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="证书列表" |
| | | width="600px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-button |
| | | style="margin-bottom: 15px;float: right" |
| | | type="primary" |
| | | @click="openAddDialog('add',{})" |
| | | >新增</el-button> |
| | | <el-table v-loading="loading" :data="dataList" :border="true" > |
| | | <el-table-column type="index" label="序号" width="80" align="center"></el-table-column> |
| | | <el-table-column label="证书名称" prop="certifityName" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" > |
| | | <template #default="scope" > |
| | | <el-button link type="primary" @click="openFile(scope.row.filePath)">查看</el-button> |
| | | <el-button link type="primary" @click="downloadFile(scope.row)">下载</el-button> |
| | | <el-button link type="primary" @click="openAddDialog('edit',scope.row)" >编辑</el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row)" >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <div class="pag-container"> |
| | | <!-- <el-pagination--> |
| | | <!-- v-model:current-page="data.queryParams.pageNum"--> |
| | | <!-- v-model:page-size="data.queryParams.pageSize"--> |
| | | <!-- :page-sizes="[10,15,20,25]"--> |
| | | <!-- layout="total, sizes, prev, pager, next, jumper"--> |
| | | <!-- :total="total"--> |
| | | <!-- @size-change="handleSizeChange"--> |
| | | <!-- @current-change="handleCurrentChange"--> |
| | | <!-- />--> |
| | | </div> |
| | | </el-dialog> |
| | | <addCertDialog ref="certRef" @getList="getCertList"></addCertDialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {reactive, ref, toRefs, defineEmits, nextTick, onMounted} from 'vue' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import addCertDialog from './addCert.vue' |
| | | import {addUser, editUser, getUserById, resetPwd} from "@/api/onlineEducation/user" |
| | | import {Base64} from "js-base64" |
| | | import {getCompany} from "@/api/onlineEducation/company"; |
| | | import {addIndustryTemp, updateIndustryTemp, updateInfoPlatforms} from "@/api/staffManage/staff"; |
| | | 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 {delSupplierById, delSupplierCert, getPerformance, getSupplierCert} from "@/api/supplier/supplierList"; |
| | | import axios from "axios"; |
| | | import {renderAsync} from "docx-preview"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const dialogVisible = ref(false) |
| | | const superRef = ref() |
| | | const certRef = ref() |
| | | const state = reactive({ |
| | | title: '', |
| | | supplierSureId: null |
| | | }) |
| | | onMounted(() => { |
| | | |
| | | }); |
| | | const loading = ref(false); |
| | | const dataList = ref([]); |
| | | const total = ref(0); |
| | | const openDialog = async (type, value) => { |
| | | state.supplierSureId = value.id |
| | | await getCertList() |
| | | dialogVisible.value = true |
| | | } |
| | | const getCertList = async () => { |
| | | const param = { |
| | | supplierSureId: state.supplierSureId |
| | | } |
| | | const res = await getSupplierCert(param) |
| | | if(res.code == 200){ |
| | | dataList.value = res.data |
| | | |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const handleClose = () => { |
| | | dialogVisible.value = false; |
| | | } |
| | | const openAddDialog = (type,value) => { |
| | | value.supplierSureId = state.supplierSureId |
| | | certRef.value.openDialog(type,value) |
| | | } |
| | | |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定删除此条数据?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delSupplierCert(val.id); |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }); |
| | | getCertList(); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | } |
| | | const downloadFile = (e)=>{ |
| | | axios.get(import.meta.env.VITE_APP_BASE_API + '/' +e.filePath,{headers:{'Content-Type': 'application/json','Authorization': `${getToken()}`},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | link.setAttribute("download", e.certifityName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件读取失败' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | const openFile = async(path)=>{ |
| | | |
| | | const ext = path.split('.').pop().toLowerCase(); |
| | | if (ext === 'doc') { |
| | | ElMessageBox.confirm('暂不支持线上预览.doc文件,是否下载查看?', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank'); |
| | | }).catch(() => { |
| | | console.log('取消预览') |
| | | }); |
| | | return |
| | | }else if(ext == 'pdf' || ext == 'jpg' || ext == 'jpeg' || ext == 'png' ){ |
| | | window.open(`${import.meta.env.VITE_APP_BASE_API}/${path}`, '_blank'); |
| | | }else{ |
| | | try { |
| | | // 1. 获取文件 |
| | | const response = await fetch(import.meta.env.VITE_APP_BASE_API + '/' + path); |
| | | const arrayBuffer = await response.arrayBuffer() |
| | | // 2. 创建新窗口 |
| | | const win = window.open('', '_blank') |
| | | win.document.write(` |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <title>预览</title> |
| | | <style> |
| | | body { margin: 20px; font-family: Arial; } |
| | | .docx-container { width: 100%; height: 100%; } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div id="container" class="docx-container"></div> |
| | | </body> |
| | | </html> |
| | | `); |
| | | // 3. 渲染 DOCX |
| | | await renderAsync(arrayBuffer, win.document.getElementById('container')); |
| | | |
| | | } catch (error) { |
| | | alert(`预览失败: ${error.message}`); |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .notice{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | .file { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="notice"> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="业绩评定表" |
| | | width="900px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" label-width="150" > |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供方名称:" prop="name" > |
| | | <el-input v-model="state.form.name" placeholder="请输入供方名称" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="地址:" prop="address" > |
| | | <el-input v-model="state.form.address" placeholder="请输入地址" type="textarea" :rows="1" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="联系人:" prop="person" > |
| | | <el-input v-model="state.form.person" placeholder="请输入联系人" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="联系电话:" prop="phone" > |
| | | <el-input v-model="state.form.phone" placeholder="请输入联系电话" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="邮编:" prop="emil" > |
| | | <el-input v-model="state.form.emil" placeholder="请输入邮编" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="供应产品:" prop="product" > |
| | | <el-input v-model="state.form.product" placeholder="请输入供应产品" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="产品类别:" prop="type" > |
| | | <el-input v-model="state.form.type" placeholder="请输入产品类别" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="评审依据:" prop="gist" > |
| | | <el-input v-model="state.form.gist" type="textarea" :rows="1" placeholder="请输入评审依据" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="验证方式:" prop="verify" > |
| | | <el-radio-group v-model="state.form.verify" :disabled="title === '查看'"> |
| | | <el-radio :label="1">现场验证</el-radio> |
| | | <el-radio :label="2">入库验证</el-radio> |
| | | <el-radio :label="3">供方资源处验证</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="state.tableData" border :span-method="arraySpanMethod" style="margin-bottom: 15px"> |
| | | <el-table-column align="center" prop="content" fixed min-width="100"></el-table-column> |
| | | <el-table-column align="center" prop="name" width="120"></el-table-column> |
| | | <el-table-column align="center" label="优(86-100)" prop="" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-input :disabled="title === '查看'" v-model="scope.row.good"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="良(71-85)" prop="" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-input :disabled="title === '查看'" v-model="scope.row.fine"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="中(60-70)" prop="" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-input :disabled="title === '查看'" v-model="scope.row.middle"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="差(<60)" prop="" min-width="120"> |
| | | <template #default="scope"> |
| | | <el-input :disabled="title === '查看'" v-model="scope.row.bad"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="conclusion" label="结论" fixed="right" min-width="85"></el-table-column> |
| | | </el-table> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="评审意见:" prop="opinion" > |
| | | <el-radio-group v-model="state.form.opinion" :disabled="title === '查看'"> |
| | | <el-radio :label="1">保留(≥80)</el-radio> |
| | | <el-radio :label="2">暂停,整改后再评价(≥65)</el-radio> |
| | | <el-radio :label="3">剔除(<65)</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参加评审人员签字:" prop="reviewUsers" > |
| | | <el-select clearable |
| | | v-model="state.checkList" |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | :disabled="title =='查看'" |
| | | filterable |
| | | style="width: 100%" |
| | | @change="changeCheckPeople" |
| | | > |
| | | <el-option |
| | | v-for="item in state.peopleList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="日期:" prop="reviewTime" > |
| | | <el-date-picker |
| | | :disabled="title === '查看'" |
| | | v-model="state.form.reviewTime" |
| | | type="date" |
| | | placeholder="请选择日期" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="审批意见:" prop="reviewMess" > |
| | | <el-input type="textarea" :rows="2" v-model="state.form.reviewMess" placeholder="请输入审批意见" :disabled="title === '查看'" style="width: 100%"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="审批人:" prop="checkId" > |
| | | <el-select clearable v-model="state.form.checkId" :disabled="title =='查看'" filterable style="width: 100%"> |
| | | <el-option |
| | | v-for="item in state.peopleList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="日期:" prop="checkTime" > |
| | | <el-date-picker |
| | | :disabled="title === '查看'" |
| | | v-model="state.form.checkTime" |
| | | type="date" |
| | | placeholder="请选择日期" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <template #footer v-if="title !== '查看'"> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleClose" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmit" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {computed, onMounted, reactive, ref, toRefs} from 'vue' |
| | | import Editor from "@/components/Editor/index.vue"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {addNotice} from "@/api/backManage/notice"; |
| | | import {addDict, editDict, getDictDetail} from "@/api/backManage/evaluate"; |
| | | import {addCompany, checkName, distributeCompany, editCompany, getCompany} from "@/api/onlineEducation/company"; |
| | | import {validEmail, verifyPhone} from "@/utils/validate"; |
| | | import {addBasic, editBasic} from "@/api/companyInfo/basicInfo"; |
| | | import Cookies from "js-cookie"; |
| | | import {addSupplier, editPerformance, editSupplier, getPerformance} from "@/api/supplier/supplierList"; |
| | | import {getUser} from "@/api/onlineEducation/user"; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const title = ref(""); |
| | | const busRef = ref(); |
| | | const length = ref() |
| | | const emit = defineEmits(["getList"]); |
| | | const validatePhone = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入手机号')) |
| | | }else{ |
| | | if(!verifyPhone(value)){ |
| | | callback(new Error('手机号格式有误')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | | companyId: null, |
| | | address: '', |
| | | checkId: '', |
| | | checkTime: '', |
| | | gist: '', |
| | | phone: '', |
| | | emil: '', |
| | | name: '', |
| | | p1: '', |
| | | p2: '', |
| | | p3: '', |
| | | p4: '', |
| | | p5: '', |
| | | p6: '', |
| | | people: '', |
| | | product: '', |
| | | reviewMess: '', |
| | | reviewTime: '', |
| | | reviewUsers: '', |
| | | type: '', |
| | | verify: '', |
| | | }, |
| | | formRules:{ |
| | | companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }], |
| | | address: [{ required: true, message: '请输入地址', trigger: 'blur' }], |
| | | gist:[{ required: true, message: '请输入评审依据', trigger: 'blur' }], |
| | | phone: [{ required: true, validator: validatePhone, trigger: 'blur' }], |
| | | people: [{ required: true, message: '请输入联系人', trigger: 'blur' }], |
| | | emil: [{ required: true, message: '请输入邮编', trigger: 'blur' }], |
| | | product: [{ required: true, message: '请输入供应产品', trigger: 'blur' }], |
| | | reviewMess: [{ required: true, message: '请选择审批意见', trigger: 'blur' }], |
| | | reviewTime: [{ required: true, message: '请输入评审日期', trigger: 'blur' }], |
| | | type: [{ required: true, message: '请输入产品类型', trigger: 'blur' }], |
| | | verify: [{ required: true, message: '请选择验证方式', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请输入供方名称', trigger: 'blur' }], |
| | | checkId: [{ required: true, message: '请选择审批人', trigger: 'blur' }], |
| | | checkTime: [{ required: true, message: '请选择审批日期', trigger: 'blur' }], |
| | | opinion: [{ required: true, message: '请选择评审意见', trigger: 'blur' }], |
| | | reviewUsers: [{ required: true, message: '请选择评审人员', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | | peopleList: [], |
| | | supplierSureId: null, |
| | | tableData: [ |
| | | { |
| | | content: '评审内容(P)', |
| | | name: '产品质量 p1', |
| | | conclusion: 'Σ(Pi)/6 =' |
| | | }, |
| | | { |
| | | name: '交货期 p2' |
| | | }, |
| | | { |
| | | |
| | | name: '履约能力 p3' |
| | | }, |
| | | { |
| | | |
| | | name: '价格 p4' |
| | | }, |
| | | { |
| | | |
| | | name: '售后服务 p5' |
| | | }, |
| | | { |
| | | name: '资历 p6' |
| | | }, |
| | | ], |
| | | checkList: [] |
| | | |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | const openDialog = async (type, value) => { |
| | | title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ; |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | state.isAdmin = userInfo.userType === 0; |
| | | state.form.companyId = value.companyId |
| | | state.supplierSureId = value.id |
| | | await getPerformanceInfo() |
| | | state.form.name = value.supplierName |
| | | state.form.address = value.supplierAddr |
| | | state.form.product = value.merito |
| | | state.form.person = value.user |
| | | state.form.phone = value.phone |
| | | await getPeopleList() |
| | | |
| | | dialogVisible.value = true; |
| | | } |
| | | const demo = ref([ |
| | | { |
| | | rage: '86-100', |
| | | field: 'good' |
| | | }, |
| | | { |
| | | rage: '71-85', |
| | | field: 'fine' |
| | | }, |
| | | { |
| | | rage: '60-70', |
| | | field: 'middle' |
| | | }, |
| | | { |
| | | rage: '0-59', |
| | | field: 'bad' |
| | | }, |
| | | ]) |
| | | const getPerformanceInfo = async () => { |
| | | const param = { |
| | | supplierSureId: state.supplierSureId |
| | | } |
| | | const res = await getPerformance(param) |
| | | if(res.code == 200){ |
| | | state.form.id = res.data.id |
| | | if(!res.data.p1){ |
| | | return |
| | | } |
| | | state.form = res.data |
| | | state.form.checkId = res.data.checkId ==0? null: res.data.checkId |
| | | state.checkList = res.data.reviewUsers ? res.data.reviewUsers.split(',').map(i => Number(i)):[] |
| | | //更新表格字段名 |
| | | const p1Field = getMatchedField(res.data.p1) |
| | | if(p1Field){ |
| | | state.tableData[0][p1Field] = res.data.p1 |
| | | } |
| | | const p2Field = getMatchedField(res.data.p2) |
| | | if(p2Field){ |
| | | state.tableData[1][p2Field] = res.data.p2 |
| | | } |
| | | const p3Field = getMatchedField(res.data.p3) |
| | | if(p3Field){ |
| | | state.tableData[2][p3Field] = res.data.p3 |
| | | } |
| | | const p4Field = getMatchedField(res.data.p4) |
| | | if(p4Field){ |
| | | state.tableData[3][p4Field] = res.data.p4 |
| | | } |
| | | const p5Field = getMatchedField(res.data.p5) |
| | | if(p5Field){ |
| | | state.tableData[4][p5Field] = res.data.p5 |
| | | } |
| | | const p6Field = getMatchedField(res.data.p6) |
| | | if(p6Field){ |
| | | state.tableData[5][p6Field] = res.data.p6 |
| | | } |
| | | const sum = res.data.p1+res.data.p2+res.data.p3+res.data.p4+res.data.p5+res.data.p6 |
| | | state.tableData[0].conclusion += (sum/6).toFixed(2) |
| | | |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const getMatchedField = (num) => { |
| | | for (const item of demo.value) { |
| | | const [min, max] = item.rage.split('-').map(Number); |
| | | if (num >= min && num <= max) { |
| | | return item.field; // 返回匹配的字段名(如 "good") |
| | | } |
| | | } |
| | | return null; // 无匹配时返回 null |
| | | } |
| | | |
| | | const onSubmit = async () => { |
| | | state.tableData[0].conclusion = 'Σ(Pi)/6 =' |
| | | if(!handleTableData()){ |
| | | return |
| | | } |
| | | const valid = await busRef.value.validate(); |
| | | if(valid){ |
| | | if(title.value === '编辑'){ |
| | | const {...data} = JSON.parse(JSON.stringify(state.form)) |
| | | data.reviewUsers = state.checkList.join(',') |
| | | const res = await editPerformance(data) |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '编辑成功' |
| | | }); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | emit("getList") |
| | | busRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | const handleTableData = () => { |
| | | console.log('dd',state.form) |
| | | const demo = ['good','fine','middle','bad'] |
| | | let sum = 0 |
| | | state.tableData[0].conclusion = 'Σ(Pi)/6 =' |
| | | for(const item of state.tableData){ |
| | | //填了两个及以上或没填 |
| | | const length = Object.keys(item).filter(key => (demo.includes(key) && item[key] !== '')).length |
| | | if(length>1 || length===0){ |
| | | ElMessage.warning(`请填写${item.name}的正确评分`) |
| | | return false; |
| | | } |
| | | //填的数字不在范围内 |
| | | const content = Object.keys(item).filter(key => (demo.includes(key) && item[key] !== '')) |
| | | if(content == 'good'){ |
| | | if(!(item[content]>=86 &&item[content]<=100)){ |
| | | ElMessage.warning(`请填写${item.name}的正确评分`) |
| | | return false |
| | | }else{ |
| | | sum+=Number(item[content]) |
| | | } |
| | | }else if(content == 'fine'){ |
| | | if(!(item[content]>=71 &&item[content]<=85)){ |
| | | ElMessage.warning(`请填写${item.name}的正确评分`) |
| | | return false |
| | | }else{ |
| | | sum+=Number(item[content]) |
| | | } |
| | | }else if(content == 'middle'){ |
| | | if(!(item[content]>=60 &&item[content]<=70)){ |
| | | ElMessage.warning(`请填写${item.name}的正确评分`) |
| | | return false |
| | | }else{ |
| | | sum+=Number(item[content]) |
| | | } |
| | | }else if(content == 'bad'){ |
| | | if(!(item[content]<60)){ |
| | | ElMessage.warning(`请填写${item.name}的正确评分`) |
| | | return false |
| | | }else{ |
| | | sum+=Number(item[content]) |
| | | } |
| | | } |
| | | item.num = Number(item[content]) |
| | | } |
| | | state.form.p1 = state.tableData[0].num |
| | | state.form.p2 = state.tableData[1].num |
| | | state.form.p3 = state.tableData[2].num |
| | | state.form.p4 = state.tableData[3].num |
| | | state.form.p5 = state.tableData[4].num |
| | | state.form.p6 = state.tableData[5].num |
| | | state.tableData[0].conclusion += (sum/6).toFixed(2) |
| | | return true |
| | | } |
| | | const handleClose = () => { |
| | | busRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | emit("getList") |
| | | |
| | | } |
| | | const reset = () => { |
| | | state.form = { |
| | | id: '', |
| | | companyId: null, |
| | | address: '', |
| | | checkId: '', |
| | | checkTime: '', |
| | | gist: '', |
| | | phone: '', |
| | | emil: '', |
| | | name: '', |
| | | p1: '', |
| | | p2: '', |
| | | p3: '', |
| | | p4: '', |
| | | p5: '', |
| | | p6: '', |
| | | people: '', |
| | | product: '', |
| | | reviewMess: '', |
| | | reviewTime: '', |
| | | reviewUsers: '', |
| | | type: '', |
| | | verify: '', |
| | | } |
| | | state.companyList = [] |
| | | state.checkList = [] |
| | | state.tableData = [ |
| | | { |
| | | content: '评审内容(P)', |
| | | name: '产品质量 p1', |
| | | conclusion: 'Σ(Pi)/6 =' |
| | | }, |
| | | { |
| | | name: '交货期 p2' |
| | | }, |
| | | { |
| | | |
| | | name: '履约能力 p3' |
| | | }, |
| | | { |
| | | |
| | | name: '价格 p4' |
| | | }, |
| | | { |
| | | |
| | | name: '售后服务 p5' |
| | | }, |
| | | { |
| | | |
| | | name: '资历 p6' |
| | | }, |
| | | ] |
| | | } |
| | | const arraySpanMethod = ( {row, column, rowIndex, columnIndex}) => { |
| | | if(columnIndex == 0 || columnIndex == 6){ |
| | | if (rowIndex === 0) { |
| | | return { |
| | | rowspan: 7, |
| | | colspan: 1 |
| | | } |
| | | } else { |
| | | // 其他行不显示(被合并) |
| | | return { |
| | | rowspan: 0, |
| | | colspan: 0 |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | const getPeopleList = async ()=> { |
| | | const queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 9999, |
| | | companyId: state.form.companyId |
| | | } |
| | | const res = await getUser(queryParams) |
| | | if(res.code == 200){ |
| | | state.peopleList = res.data.list?res.data.list:[] |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }; |
| | | const changeCheckPeople = (val) => { |
| | | state.form.reviewUsers = state.checkList.join(',') |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .notice{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | .file { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | } |
| | | } |
| | | </style> |
对比新文件 |
| | |
| | | export const traitList = [ |
| | | { |
| | | id: 1, |
| | | name: '成批生产' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '流水线生产' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '单台生产' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '其他' |
| | | }, |
| | | ] |
| | | export const facilityList= [ |
| | | { |
| | | id: 1, |
| | | name: '齐全、良好' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '基本齐全、尚可' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '不全' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '代理商' |
| | | }, |
| | | ] |
| | | export const craftList= [ |
| | | { |
| | | id: 1, |
| | | name: '齐备' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '有一部分' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '没有' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '代理商' |
| | | }, |
| | | ] |
| | | export const developList= [ |
| | | { |
| | | id: 1, |
| | | name: '能自行设计开发新品' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '只能开发简单产品' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '没有自行开发能力,代理商' |
| | | }, |
| | | ] |
| | | export const teamWorkList=[ |
| | | { |
| | | id: 1, |
| | | name: '是外资企业' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '是合资企业' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '给企业提供产品' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '无对外合作经验' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '有对外合作经验,但不经常发生' |
| | | }, |
| | | ] |
| | | export const qualificationList = [ |
| | | { |
| | | id: 1, |
| | | name: '营业执照' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '高新技术企业' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 6, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 7, |
| | | name: '资质代理商' |
| | | }, |
| | | { |
| | | id: 8, |
| | | name: '其他资质情况:' |
| | | }, |
| | | ] |
| | | export const productList=[ |
| | | { |
| | | id: 1, |
| | | name: '通过产品认证' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '没有产品认证' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '通过质量体系认证' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '没有体系认证' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '其他认证(请指出具体内容):' |
| | | }, |
| | | ] |
对比新文件 |
| | |
| | | <template> |
| | | <div class="notice"> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="供方质量保证能力调查表" |
| | | width="700px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" > |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供方名称:" prop="name" > |
| | | <el-input v-model="state.form.name" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="负责人或联系人:" prop="person" > |
| | | <el-input v-model="state.form.person" :rows="1" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="供方地址:" prop="address" > |
| | | <el-input v-model="state.form.address" type="textarea" :rows="1" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="邮编:" prop="emil" > |
| | | <el-input v-model="state.form.emil" :rows="1" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="电话/传真:" prop="phone" > |
| | | <el-input v-model="state.form.phone" :rows="1" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="供方主要产品:" prop="productName" > |
| | | <el-input v-model="state.form.productName" type="textarea" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="生产特点:" prop="trait" > |
| | | <el-checkbox-group v-model="state.checkTraitList" style="display: flex" :disabled="title === '查看'" @change="changeCheck('trait')"> |
| | | <div v-for="(item,index) in traitList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;">{{item.name}}</el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="生产设备:" prop="facility" > |
| | | <el-checkbox-group v-model="state.checkFacilityList" style="display: flex" :disabled="title === '查看'" @change="changeCheck('facility')"> |
| | | <div v-for="(item,index) in facilityList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;">{{item.name}}</el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="工艺文件:" prop="craft" > |
| | | <el-checkbox-group v-model="state.checkCraftList" style="display: flex" :disabled="title === '查看'" @change="changeCheck('craft')"> |
| | | <div v-for="(item,index) in craftList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;">{{item.name}}</el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="新品开发能力:" prop="develop" > |
| | | <el-checkbox-group v-model="state.checkDevelopList" @change="changeCheck('develop')" :disabled="title === '查看'" class="custom-checkbox-group"> |
| | | <div v-for="(item,index) in developList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;">{{item.name}}</el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="国际合作经验:" prop="teamWork" > |
| | | <el-checkbox-group v-model="state.checkTeamWorkList" @change="changeCheck('teamWork')" :disabled="title === '查看'" style="display: flex" class="custom-checkbox-group"> |
| | | <div v-for="(item,index) in teamWorkList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;">{{item.name}}</el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="公司资质情况:" prop="qualification" > |
| | | <el-checkbox-group v-model="state.checkQualificationList" :disabled="title === '查看'" @change="changeCheck('qualification')" style="display: flex" class="custom-checkbox-group"> |
| | | <div v-for="(item,index) in state.qualificationList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;"> |
| | | {{item.name}} |
| | | <el-input |
| | | :disabled="title === '查看'" |
| | | v-if="item.id == 8 && state.checkQualificationList.includes(8)" |
| | | v-model="state.form.otherQualifi" |
| | | style="margin-left: 5px;width: 140px" |
| | | placeholder="请输入其他资质情况" |
| | | size="small" |
| | | /> |
| | | </el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="是否通过产品或体系认证:" prop="product" > |
| | | <el-checkbox-group v-model="state.checkProductList" :disabled="title === '查看'" style="display: flex" @change="changeCheck('product')" class="custom-checkbox-group"> |
| | | <div v-for="(item,index) in state.productList"> |
| | | <el-checkbox :label="item.id" :key="item.id" style="margin-left: 20px;"> |
| | | {{item.name}} |
| | | <el-input |
| | | :disabled="title === '查看'" |
| | | v-if="item.id == 5 && state.checkProductList.includes(5)" |
| | | v-model="state.form.otherProduct" |
| | | style="margin-left: 5px;width: 160px" |
| | | placeholder="请输入其他认证" |
| | | size="small" |
| | | /> |
| | | </el-checkbox> |
| | | </div> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="供方企业确认:" prop="companyMess" > |
| | | <el-input v-model="state.form.companyMess" type="textarea" :rows="2" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="供方负责人:" prop="chargeName" > |
| | | <el-input v-model="state.form.chargeName" :rows="1" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="日期:" prop="chargeTime" > |
| | | <el-date-picker |
| | | :disabled="title === '查看'" |
| | | v-model="state.form.chargeTime" |
| | | type="date" |
| | | value-format="YYYY-MM-DD" |
| | | placeholder="请选择编制日期" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer v-if="title !== '查看'"> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleClose" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onSubmit" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import {onMounted, reactive, ref, toRefs} from 'vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import {validEmail, verifyPhone} from "@/utils/validate"; |
| | | import Cookies from "js-cookie"; |
| | | import {addSupplier, editQuality, editSupplier, getPerformance, getQuality} from "@/api/supplier/supplierList"; |
| | | import {getUser} from "@/api/onlineEducation/user"; |
| | | import {traitList,facilityList,craftList,developList,teamWorkList} from "@/views/work/qualityInfo/supplierQuality/supplierList/components/qualityDatas"; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const title = ref(""); |
| | | const busRef = ref(); |
| | | const length = ref() |
| | | const emit = defineEmits(["getList"]); |
| | | const validatePhone = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入手机号')) |
| | | }else{ |
| | | if(!verifyPhone(value)){ |
| | | callback(new Error('手机号格式有误')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | | companyId: null, |
| | | name: '', |
| | | address: '', |
| | | product: '', |
| | | person: '', |
| | | phone: '', |
| | | emil: '', |
| | | trait: '', |
| | | facility: '', |
| | | craft: '', |
| | | develop: '', |
| | | teamWork: '', |
| | | qualification: '', |
| | | chargeName: '', |
| | | chargeTime: '', |
| | | companyMess: '', |
| | | otherQualifi: '', |
| | | otherProduct: '' |
| | | }, |
| | | formRules:{ |
| | | companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }], |
| | | address: [{ required: true, message: '请输入地址', trigger: 'blur' }], |
| | | phone: [{ required: true, validator: validatePhone, trigger: 'blur' }], |
| | | people: [{ required: true, message: '请输入联系人', trigger: 'blur' }], |
| | | emil: [{ required: true, message: '请输入邮编', trigger: 'blur' }], |
| | | productName: [{ required: true, message: '请输入供应产品', trigger: 'blur' }], |
| | | name: [{ required: true, message: '请输入供方名称', trigger: 'blur' }], |
| | | trait: [{ required: true, message: '请选择生产特点', trigger: 'blur' }], |
| | | facility: [{ required: true, message: '请选择生产设备', trigger: 'blur' }], |
| | | craft: [{ required: true, message: '请选择工艺文件', trigger: 'blur' }], |
| | | develop: [{ required: true, message: '请选择新品开发能力', trigger: 'blur' }], |
| | | teamWork: [{ required: true, message: '请选择国际合作经验', trigger: 'blur' }], |
| | | qualification: [{ required: true, message: '请选择公司资质情况', trigger: 'blur' }], |
| | | product: [{ required: true, message: '请选择是否通过产品或体系认证', trigger: 'blur' }], |
| | | // chargeName: [{ required: true, message: '请输入供方负责人', trigger: 'blur' }], |
| | | // companyMess: [{ required: true, message: '请输入供方企业确认', trigger: 'blur' }], |
| | | // chargeTime: [{ required: true, message: '请选择日期', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [], |
| | | |
| | | checkTraitList: [], |
| | | checkFacilityList: [], |
| | | checkCraftList: [], |
| | | checkDevelopList: [], |
| | | checkTeamWorkList: [], |
| | | checkQualificationList: [], |
| | | checkProductList: [], |
| | | peopleList: [], |
| | | qualificationList: [ |
| | | { |
| | | id: 1, |
| | | name: '营业执照' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '高新技术企业' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 6, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 7, |
| | | name: '资质代理商' |
| | | }, |
| | | { |
| | | id: 8, |
| | | name: '其他资质情况:' |
| | | }, |
| | | ], |
| | | productList: [ |
| | | { |
| | | id: 1, |
| | | name: '通过产品认证' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '没有产品认证' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '通过质量体系认证' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '没有体系认证' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '其他认证(请指出具体内容):' |
| | | }, |
| | | ] |
| | | }) |
| | | |
| | | onMounted(() => { |
| | | |
| | | }) |
| | | const openDialog = async (type, value,companyList) => { |
| | | title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '查看' ; |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | state.isAdmin = userInfo.userType === 0; |
| | | state.form.companyId = value.companyId |
| | | state.supplierSureId = value.id |
| | | await getQualityInfo() |
| | | state.form.name = value.supplierName |
| | | state.form.address = value.supplierAddr |
| | | state.form.productName = value.merito |
| | | state.form.person = value.user |
| | | state.form.phone = value.phone |
| | | await getPeopleList() |
| | | dialogVisible.value = true; |
| | | } |
| | | const getQualityInfo = async () => { |
| | | const param = { |
| | | supplierSureId: state.supplierSureId |
| | | } |
| | | const res = await getQuality(param) |
| | | if(res.code == 200){ |
| | | state.form = res.data |
| | | state.checkTraitList = res.data.trait ? res.data.trait.split(',').map(i => Number(i)):[] |
| | | state.checkFacilityList = res.data.facility ? res.data.facility.split(',').map(i => Number(i)):[] |
| | | state.checkCraftList = res.data.craft ? res.data.craft.split(',').map(i => Number(i)):[] |
| | | state.checkDevelopList = res.data.develop ? res.data.develop.split(',').map(i => Number(i)):[] |
| | | state.checkTeamWorkList = res.data.teamWork ? res.data.teamWork.split(',').map(i => Number(i)):[] |
| | | state.checkQualificationList = res.data.qualification ? res.data.qualification.split(',').map(i => Number(i)):[] |
| | | state.checkProductList = res.data.product ? res.data.product.split(',').map(i => Number(i)):[] |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const onSubmit = async () => { |
| | | const valid = await busRef.value.validate(); |
| | | if(valid){ |
| | | if(title.value === '编辑'){ |
| | | const {...data} = JSON.parse(JSON.stringify(state.form)) |
| | | const res = await editQuality(data) |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '编辑成功' |
| | | }); |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | emit("getList") |
| | | busRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | } |
| | | } |
| | | } |
| | | const getPeopleList = async ()=> { |
| | | const queryParams = { |
| | | pageNum: 1, |
| | | pageSize: 9999, |
| | | companyId: state.form.companyId |
| | | } |
| | | const res = await getUser(queryParams) |
| | | if(res.code == 200){ |
| | | state.peopleList = res.data.list?res.data.list:[] |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }; |
| | | const changeCheck = (type) => { |
| | | switch (type) { |
| | | case 'trait': state.form.trait = state.checkTraitList.join(','); break; |
| | | case 'facility': state.form.facility = state.checkFacilityList.join(','); break; |
| | | case 'craft': state.form.craft = state.checkCraftList.join(','); break; |
| | | case 'develop': state.form.develop = state.checkDevelopList.join(','); break; |
| | | case 'teamWork': state.form.teamWork = state.checkTeamWorkList.join(','); break; |
| | | case 'qualification': state.form.qualification = state.checkQualificationList.join(','); if(!state.checkQualificationList.includes(8))state.form.otherQualifi = '' ;break; |
| | | case 'product': state.form.product = state.checkProductList.join(',');if(!state.checkProductList.includes(5))state.form.otherProduct = ''; break; |
| | | } |
| | | |
| | | } |
| | | const handleClose = () => { |
| | | busRef.value.clearValidate(); |
| | | reset(); |
| | | dialogVisible.value = false; |
| | | emit("getList") |
| | | |
| | | } |
| | | const reset = () => { |
| | | state.form = { |
| | | id: '', |
| | | companyId: null, |
| | | supplierName: '', |
| | | supplierType: '', |
| | | user: '', |
| | | phone: '', |
| | | emil: '', |
| | | merito: '', |
| | | content: '', |
| | | } |
| | | state.companyList = [] |
| | | } |
| | | defineExpose({ |
| | | openDialog |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .notice{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | :deep(.el-checkbox-group) { |
| | | flex: 0 0 75%; |
| | | box-sizing: border-box; |
| | | padding: 5px 10px 5px 0; /* 上下间距+右侧留空 */ |
| | | margin-right: 0; |
| | | white-space: normal; /* 允许文本换行 */ |
| | | } |
| | | .custom-checkbox-group{ |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | align-items: center; /* 垂直居中 */ |
| | | |
| | | } |
| | | |
| | | } |
| | | </style> |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="供应商名称:" prop="supplierName" > |
| | | <el-form-item label="供货单位:" prop="supplierName" > |
| | | <el-input v-model="state.form.supplierName" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="供应商类型:" prop="supplierType" > |
| | | <el-input v-model="state.form.supplierType" :disabled="title === '查看'"/> |
| | | <el-form-item label="地址:" prop="supplierAddr" > |
| | | <el-input v-model="state.form.supplierAddr" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="供应品名称:" prop="merito" > |
| | | <el-input v-model="state.form.merito" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="联系人:" prop="user" > |
| | | <el-input v-model="state.form.user" :disabled="title === '查看'"/> |
| | |
| | | <el-form-item label="联系电话:" prop="phone" > |
| | | <el-input v-model="state.form.phone" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱:" prop="emil" > |
| | | <el-input v-model="state.form.emil" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="主营产品:" prop="merito" > |
| | | <el-input v-model="state.form.merito" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | <el-form-item label="服务内容:" prop="content" > |
| | | <el-input v-model="state.form.content" :disabled="title === '查看'"/> |
| | | <el-form-item label="备注:" prop="remark" > |
| | | <el-input v-model="state.form.remark" :disabled="title === '查看'"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer v-if="title !== '查看'"> |
| | |
| | | } |
| | | } |
| | | } |
| | | const validateEmail = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入邮箱')) |
| | | }else{ |
| | | if(!validEmail(value)){ |
| | | callback(new Error('邮箱格式有误')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | | companyId: null, |
| | | supplierName: '', |
| | | supplierType: '', |
| | | supplierAddr: '', |
| | | user: '', |
| | | phone: '', |
| | | emil: '', |
| | | merito: '', |
| | | content: '', |
| | | remark: '', |
| | | }, |
| | | formRules:{ |
| | | companyId: [{ required: true, message: '请选择企业', trigger: 'blur' }], |
| | | supplierName: [{ required: true, message: '请输入供应商名称', trigger: 'blur' }], |
| | | supplierType:[{ required: true, message: '请输入供应商类型', trigger: 'blur' }], |
| | | supplierAddr:[{ required: true, message: '请输入地址', trigger: 'blur' }], |
| | | user: [{ required: true, message: '请输入联系人', trigger: 'blur' }], |
| | | phone: [{ required: true, validator: validatePhone, trigger: 'blur' }], |
| | | emil: [{ required: true, validator: validateEmail, trigger: 'blur' }], |
| | | merito: [{ required: true, message: '请输入主营产品', trigger: 'blur' }], |
| | | content: [{ required: true, message: '请输入服务内容', trigger: 'blur' }], |
| | | }, |
| | | isAdmin: false, |
| | | companyList: [] |
| | |
| | | id: '', |
| | | companyId: null, |
| | | supplierName: '', |
| | | supplierType: '', |
| | | supplierAddr: '', |
| | | user: '', |
| | | phone: '', |
| | | emil: '', |
| | | merito: '', |
| | | content: '', |
| | | remark: '', |
| | | } |
| | | state.companyList = [] |
| | | } |
| | |
| | | <el-button type="primary" style="margin-left: 30px" @click="searchClick">查询</el-button> |
| | | <el-button plain @click="reset">重置</el-button> |
| | | </el-form-item> |
| | | <el-form-item style="margin-left: 15px"> |
| | | <el-button |
| | | type="primary" |
| | | @click="exportData" |
| | | >导出</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="index" label="序号" width="80" align="center"></el-table-column> |
| | | <el-table-column label="供应商名称" prop="supplierName" align="center" /> |
| | | <el-table-column label="供应商类型" prop="supplierType" align="center" /> |
| | | <el-table-column label="供货单位" prop="supplierName" align="center" /> |
| | | <el-table-column label="地址" prop="supplierAddr" align="center" /> |
| | | <el-table-column label="供应品名称" prop="merito" align="center" /> |
| | | <el-table-column label="联系人" prop="user" align="center" /> |
| | | <el-table-column label="联系电话" prop="phone" align="center" /> |
| | | <el-table-column label="邮箱" prop="emil" align="center" /> |
| | | <el-table-column label="主营产品" prop="merito" align="center" /> |
| | | <el-table-column label="服务内容" prop="content" align="center" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" > |
| | | <el-table-column label="备注" prop="remark" align="center" /> |
| | | <el-table-column label="业绩评定表" align="center" class-name="small-padding fixed-width" width="160" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openPerformance('review',scope.row)">查看</el-button> |
| | | <el-button link type="primary" @click="openPerformance('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" @click = 'exportPerformance(scope.row)'>导出</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="质量保证能力调查表" align="center" class-name="small-padding fixed-width" width="160" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openQuality('review',scope.row)">查看</el-button> |
| | | <el-button link type="primary" @click="openQuality('edit',scope.row)">编辑</el-button> |
| | | <el-button link type="primary" @click = 'exportQuality(scope.row)'>导出</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="证书" align="center" class-name="small-padding fixed-width" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openCert('review',scope.row)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDialog('review',scope.row)" >查看</el-button> |
| | | <el-button link type="primary" @click="openDialog('edit',scope.row)" >编辑</el-button> |
| | |
| | | /> |
| | | </div> |
| | | <supplierDialog ref="noticeRef" @getList = "getList"></supplierDialog> |
| | | <performanceTable ref="performanceRef" @getList = "getList"></performanceTable> |
| | | <qualityDialog ref="qualityRef" @getList = "getList"></qualityDialog> |
| | | <certDialog ref="certRef" @getList = "getList"></certDialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, onMounted, reactive, ref, toRefs} from "vue"; |
| | | import supplierDialog from "./components/supplierDialog.vue" |
| | | import performanceTable from './components/performanceTableDialog.vue' |
| | | import qualityDialog from './components/qualityDialog.vue' |
| | | import certDialog from './components/certDialog.vue' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {getCompany} from "@/api/onlineEducation/company"; |
| | | import Cookies from "js-cookie"; |
| | | import {generateWordDocument} from "@/utils/exportWord"; |
| | | import {delBasic, getBasic} from "@/api/companyInfo/basicInfo"; |
| | | import {delSupplier, getSupplierPage} from "@/api/supplier/supplierList"; |
| | | |
| | | import {delSupplierById, getPerformance, getQuality, getSupplierPage} from "@/api/supplier/supplierList"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const noticeRef = ref(); |
| | | const performanceRef = ref(); |
| | | const qualityRef = ref(); |
| | | const certRef = ref(); |
| | | |
| | | const loadingCompany = ref(false) |
| | | const choosedData = ref([]) |
| | | const data = reactive({ |
| | |
| | | companyId: null, |
| | | }, |
| | | companyList: [], |
| | | isAdmin: false |
| | | isAdmin: false, |
| | | verifyList:[{id: 1,label: '现场验证'},{id: 2,label: '入库验证'},{id: 3,label: '供方货源处验证'},], |
| | | opinionList:[{id: 1,label: '保留(≥80)'},{id: 2,label: '暂停,整改后再评价(≥65)'},{id: 3,label: '剔除(<65)'},], |
| | | traitList:[ |
| | | { |
| | | id: 1, |
| | | name: '成批生产' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '流水线生产' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '单台生产' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '其他' |
| | | }, |
| | | ], |
| | | facilityList:[ |
| | | { |
| | | id: 1, |
| | | name: '齐全、良好' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '基本齐全、尚可' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '不全' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '代理商' |
| | | }, |
| | | ], |
| | | craftList:[ |
| | | { |
| | | id: 1, |
| | | name: '齐备' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '有一部分' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '没有' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '代理商' |
| | | }, |
| | | ], |
| | | developList:[ |
| | | { |
| | | id: 1, |
| | | name: '能自行设计开发新品' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '只能开发简单产品' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '没有自行开发能力,代理商' |
| | | }, |
| | | ], |
| | | teamWorkList:[ |
| | | { |
| | | id: 1, |
| | | name: '是外资企业' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '是合资企业' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '给企业提供产品' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '无对外合作经验' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '有对外合作经验,但不经常发生' |
| | | }, |
| | | ], |
| | | qualificationList:[ |
| | | { |
| | | id: 1, |
| | | name: '营业执照' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '高新技术企业' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '有效期内' |
| | | }, |
| | | { |
| | | id: 6, |
| | | name: '有效期外' |
| | | }, |
| | | { |
| | | id: 7, |
| | | name: '资质代理商' |
| | | }, |
| | | { |
| | | id: 8, |
| | | name: '其他资质情况:' |
| | | }, |
| | | ], |
| | | productList:[ |
| | | { |
| | | id: 1, |
| | | name: '通过产品认证' |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: '没有产品认证' |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: '通过质量体系认证' |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: '没有体系认证' |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: '其他认证(请指出具体内容):' |
| | | }, |
| | | ] |
| | | }); |
| | | const dataList = ref([]); |
| | | const total = ref(0); |
| | |
| | | if(data.isAdmin){ |
| | | getCompanyList() |
| | | } |
| | | |
| | | |
| | | }); |
| | | const getList = async () => { |
| | | loading.value = true; |
| | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false; |
| | | loading.value = false |
| | | } |
| | | |
| | | const searchClick = () => { |
| | |
| | | } |
| | | const openDialog = (type, value) => { |
| | | noticeRef.value.openDialog(type, value,data.companyList); |
| | | } |
| | | const openPerformance = (type, value) => { |
| | | performanceRef.value.openDialog(type, value); |
| | | } |
| | | const openQuality = (type,value) => { |
| | | qualityRef.value.openDialog(type, value); |
| | | } |
| | | const openCert = (type,value) => { |
| | | certRef.value.openDialog(type, value); |
| | | } |
| | | const selectValue = (val) => { |
| | | data.companyList.forEach(item => { |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await delSupplier(val.id); |
| | | const res = await delSupplierById(val.id); |
| | | if(res.code === 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | |
| | | } |
| | | }) |
| | | } |
| | | const qualityPath = ref('/qualityExample.docx') |
| | | const exportQuality = async (val) => { |
| | | let state = {} |
| | | const param = { |
| | | supplierSureId: val.id |
| | | } |
| | | const res = await getQuality(param) |
| | | if(res.code == 200){ |
| | | state = res.data |
| | | state.productName = val.merito |
| | | if(state.otherQualifi){ |
| | | data.qualificationList.forEach((item) => { |
| | | if(item.id == 8){ |
| | | item.name = item.name+ state.otherQualifi |
| | | } |
| | | }) |
| | | } |
| | | if(state.otherProduct){ |
| | | data.productList.forEach((item) => { |
| | | if(item.id == 5){ |
| | | item.name = item.name+ state.otherProduct |
| | | } |
| | | }) |
| | | } |
| | | await handleCheckData(res.data) |
| | | state.traitList = data.traitList |
| | | state.facilityList = data.facilityList |
| | | state.craftList = data.craftList |
| | | const teamWorkData = formatCheckboxData(data.teamWorkList) |
| | | state.teamWorkList = teamWorkData |
| | | const developData = formatCheckboxData(data.developList) |
| | | state.developList = developData |
| | | const qualificationData = formatCheckboxData(data.qualificationList,'quality') |
| | | state.qualificationList = qualificationData |
| | | const productData = formatCheckboxData(data.productList) |
| | | state.productList = productData |
| | | state.chargeTime = state.chargeTime?state.chargeTime.substring(0,10):'' |
| | | try { |
| | | generateWordDocument(qualityPath.value, state, val.supplierName+'_供方质量保证能力调查表.docx'); |
| | | await setTableData() |
| | | } catch (error){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '导出失败' |
| | | }); |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | function formatCheckboxData(items,type) { |
| | | return items.reduce((rows, item, index) => { |
| | | if(type == 'quality'){ |
| | | if (index % 3 === 0) { |
| | | // 创建新行,添加第一个复选框 |
| | | rows.push({ check1: item }); |
| | | } else if (index % 3 === 1 && rows.length > 0) { |
| | | // 向当前行添加第二个复选框 |
| | | const currentRow = rows[rows.length - 1]; |
| | | currentRow.check2 = item; |
| | | } else if (index % 3 === 2 && rows.length > 0) { |
| | | // 向当前行添加第三个复选框 |
| | | const currentRow = rows[rows.length - 1]; |
| | | currentRow.check3 = item; |
| | | } |
| | | }else{ |
| | | if (index % 2 === 0) { |
| | | // 创建新行,添加第一个复选框 |
| | | rows.push({ check1: item }); |
| | | } else { |
| | | // 向最后一行添加第二个复选框 |
| | | const lastRow = rows[rows.length - 1]; |
| | | lastRow.check2 = item; |
| | | } |
| | | } |
| | | return rows; |
| | | }, []); |
| | | } |
| | | const handleCheckData = (val) =>{ |
| | | const idSetTrait = new Set(val.trait.split(',').map((i => Number(i)))) |
| | | data.traitList.forEach(item => { |
| | | if (idSetTrait.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetFacility = new Set(val.facility.split(',').map((i => Number(i)))) |
| | | data.facilityList.forEach(item => { |
| | | if (idSetFacility.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetCraft = new Set(val.craft.split(',').map((i => Number(i)))) |
| | | data.craftList.forEach(item => { |
| | | if (idSetCraft.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetDevelop = new Set(val.develop.split(',').map((i => Number(i)))) |
| | | data.developList.forEach(item => { |
| | | if (idSetDevelop.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetTeamWork = new Set(val.teamWork.split(',').map((i => Number(i)))) |
| | | data.teamWorkList.forEach(item => { |
| | | if (idSetTeamWork.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetQualification = new Set(val.qualification.split(',').map((i => Number(i)))) |
| | | data.qualificationList.forEach(item => { |
| | | if (idSetQualification.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | const idSetProduct = new Set(val.product.split(',').map((i => Number(i)))) |
| | | data.productList.forEach(item => { |
| | | if (idSetProduct.has(item.id)) { |
| | | item.checked = true; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const performancePath = ref('/performanceExample.docx') |
| | | const exportPerformance = async (val) => { |
| | | let state = {} |
| | | const param = { |
| | | supplierSureId: val.id |
| | | } |
| | | const res = await getPerformance(param) |
| | | if(res.code == 200){ |
| | | // if(!res.data.p1){ |
| | | // ElMessage.warning('暂无数据!') |
| | | // return |
| | | // } |
| | | state = res.data |
| | | state.tableData = [{name: '产品质量 p1', good: '', fine: '', middle: '', bad: ''}, |
| | | {name: '交货期 p2', good: '', fine: '', middle: '', bad: ''}, |
| | | {name: '履约能力 p3', good: '', fine: '', middle: '', bad: ''}, |
| | | {name: '价格 p4', good: '', fine: '', middle: '', bad: ''}, |
| | | {name: '售后服务 p5', good: '', fine: '', middle: '', bad: ''}, |
| | | {name: '资历 p6', good: '', fine: '', middle: '', bad: ''}, |
| | | ] |
| | | //更新表格字段名 |
| | | const p1Field = getMatchedField(res.data.p1) |
| | | if(p1Field){ |
| | | state.tableData[0][p1Field] = res.data.p1 |
| | | } |
| | | const p2Field = getMatchedField(res.data.p2) |
| | | if(p2Field){ |
| | | state.tableData[1][p2Field] = res.data.p2 |
| | | } |
| | | const p3Field = getMatchedField(res.data.p3) |
| | | if(p3Field){ |
| | | state.tableData[2][p3Field] = res.data.p3 |
| | | } |
| | | const p4Field = getMatchedField(res.data.p4) |
| | | if(p4Field){ |
| | | state.tableData[3][p4Field] = res.data.p4 |
| | | } |
| | | const p5Field = getMatchedField(res.data.p5) |
| | | if(p5Field){ |
| | | state.tableData[4][p5Field] = res.data.p5 |
| | | } |
| | | const p6Field = getMatchedField(res.data.p6) |
| | | if(p6Field){ |
| | | state.tableData[5][p6Field] = res.data.p6 |
| | | } |
| | | const sum = res.data.p1+res.data.p2+res.data.p3+res.data.p4+res.data.p5+res.data.p6 |
| | | state.tableData = state.tableData.map((i,index) => { |
| | | return { |
| | | ...i, |
| | | list: [{ |
| | | first: index == 0, |
| | | conclusion:'Σ(Pi)/6 ='+(sum/6).toFixed(2) |
| | | }] |
| | | } |
| | | }) |
| | | data.verifyList.forEach(i => { |
| | | i.checked = i.id != state.verify |
| | | }) |
| | | state.verifyList = data.verifyList |
| | | data.opinionList.forEach(i => { |
| | | i.checked = i.id != state.opinion |
| | | }) |
| | | state.opinionList = data.opinionList |
| | | state.reviewTime = state.reviewTime?state.reviewTime.substring(0,10):'' |
| | | state.checkTime = state.checkTime?state.checkTime.substring(0,10):'' |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | try { |
| | | generateWordDocument(performancePath.value, state, val.supplierName+'_业绩评定表.docx'); |
| | | } catch (error){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '导出失败' |
| | | }); |
| | | } |
| | | |
| | | } |
| | | const demo = ref([ |
| | | { |
| | | rage: '86-100', |
| | | field: 'good' |
| | | }, |
| | | { |
| | | rage: '71-85', |
| | | field: 'fine' |
| | | }, |
| | | { |
| | | rage: '60-70', |
| | | field: 'middle' |
| | | }, |
| | | { |
| | | rage: '0-59', |
| | | field: 'bad' |
| | | }, |
| | | ]) |
| | | const getMatchedField = (num) => { |
| | | for (const item of demo.value) { |
| | | const [min, max] = item.rage.split('-').map(Number); |
| | | if (num >= min && num <= max) { |
| | | return item.field; // 返回匹配的字段名(如 "good") |
| | | } |
| | | } |
| | | return null; // 无匹配时返回 null |
| | | } |
| | | const exportData = () => { |
| | | startGeneration() |
| | | } |
| | | const templatePath = ref('/supplierExample.docx') |
| | | const startGeneration = async () => { |
| | | const supplierList = {} |
| | | supplierList.tableData = dataList.value.map((item,index) => { |
| | | return{ |
| | | ...item, |
| | | num: index+1 |
| | | } |
| | | }) |
| | | try { |
| | | generateWordDocument(templatePath.value, supplierList, '合格供方名录.docx'); |
| | | } catch (error){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '导出失败' |
| | | }); |
| | | } |
| | | } |
| | | const setTableData = () => { |
| | | data.traitList=[{id: 1, name: '成批生产'}, {id: 2, name: '流水线生产'}, {id: 3, name: '单台生产'}, {id: 4, name: '其他'},] |
| | | data.facilityList=[{id: 1, name: '齐全、良好'}, {id: 2, name: '基本齐全、尚可'}, {id: 3, name: '不全'}, {id: 4, name: '代理商'},] |
| | | data.craftList=[{id: 1, name: '齐备'}, {id: 2, name: '有一部分'}, {id: 3, name: '没有'}, {id: 4, name: '代理商'},] |
| | | data.developList=[{id: 1, name: '能自行设计开发新品'}, {id: 2, name: '只能开发简单产品'}, {id: 3, name: '没有自行开发能力,代理商'},] |
| | | data.teamWorkList=[{id: 1, name: '是外资企业'}, {id: 2, name: '是合资企业'}, {id: 3, name: '给企业提供产品'}, {id: 4, name: '无对外合作经验'}, {id: 5, name: '有对外合作经验,但不经常发生'},] |
| | | data.qualificationList=[{id: 1, name: '营业执照'}, {id: 2, name: '有效期内'}, {id: 3, name: '有效期外'}, {id: 4, name: '高新技术企业'}, {id: 5, name: '有效期内'}, {id: 6, name: '有效期外'}, {id: 7, name: '资质代理商'}, {id: 8, name: '其他资质情况:'},] |
| | | data.productList=[{id: 1, name: '通过产品认证'}, {id: 2, name: '没有产品认证'}, {id: 3, name: '通过质量体系认证'}, {id: 4, name: '没有体系认证'}, {id: 5, name: '其他认证(请指出具体内容):'},] |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .pag-container{ |