| | |
| | | data: data |
| | | }) |
| | | } |
| | | export function exportBasicInfo(data) { |
| | | return request({ |
| | | url: '/hazmat-basic/importExcel', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function exportProductInfo(data) { |
| | | return request({ |
| | | url: '/product-basic/importExcel', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | console.log(firstPage.value,'firstPage.value') |
| | | if(Cookies.get('configInfo')){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config.logoPath != ''){ |
| | | if(config && config.logoPath != ''){ |
| | | logoImg.value = import.meta.env.VITE_APP_BASE_API + "/" + config.logoPath |
| | | }else { |
| | | logoImg.value = logo |
| | |
| | | }) |
| | | |
| | | onMounted(()=>{ |
| | | if(Cookies.get('configInfo')){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config){ |
| | | showFinishPro.value = config.useProd === 1; |
| | | }else { |
| | | showFinishPro.value = true |
| | |
| | | hazmatType: [{ required: true, message: '请输入试剂类型', trigger: 'blur' }], |
| | | manufacturer: [{ required: true, message: '请输入厂家', trigger: 'blur' }], |
| | | metering: [{ required: true, message: '请输入包装数量', trigger: 'blur' }], |
| | | perBox: [{ required: true, message: '请输入每箱数量', trigger: 'blur' }], |
| | | // perBox: [{ required: true, message: '请输入每箱数量', trigger: 'blur' }], |
| | | price: [{ required: true, message: '请输入含税价格', trigger: 'blur' }], |
| | | productSn: [{ required: true, validator: validateName, trigger: 'blur' }], |
| | | supplier: [{ required: true, message: '请输入供应商', trigger: 'blur' }], |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="display: flex;flex-direction: column"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | style="width: 70px;margin-bottom: 10px" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | <div style="display: flex"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | style="width: 70px;margin-bottom: 10px" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | style="width: 80px;margin-bottom: 10px" |
| | | @click="exportData" |
| | | >批量导入</el-button> |
| | | </div> |
| | | |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item label="名称:" > |
| | | <el-input v-model="data.queryParams.name" placeholder="请输入危化品名称"></el-input> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="含税售价" prop="price" align="center"/> |
| | | <el-table-column label="每箱数量" prop="perBox" align="center"/> |
| | | <el-table-column label="每箱数量" prop="perBox" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.perBox === 0 || scope.row.perBox === null ? '--' : scope.row.perBox}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="最小包装类型" prop="minPackage" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.minPackage == 0 ? '瓶' :scope.row.minPackage == 1?'袋':scope.row.minPackage == 2?'桶 ':scope.row.minPackage == 3?'盒':scope.row.minPackage == 4?'箱':'其他'}}</span> |
| | |
| | | /> |
| | | |
| | | <basic-dialog ref="dialogRef" @getList=getList></basic-dialog> |
| | | <el-dialog |
| | | v-model="exportDialog" |
| | | title="批量导入危化品" |
| | | width="500px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form size="default" ref="busRef" label-width="150px" > |
| | | <el-form-item label="危化品表格模板:"> |
| | | <el-button type="primary" plain @click="downloadFile">下载模板</el-button> |
| | | </el-form-item> |
| | | <div style="color: #ed5565;margin-left: 20px;margin-top: -8px;margin-bottom: 18px"> |
| | | 导入危化品基础数据须依据此模板 |
| | | </div> |
| | | <el-form-item label="危化品表格文件:"> |
| | | <el-upload |
| | | :auto-upload="false" |
| | | action="#" |
| | | :file-list="data.fileList" |
| | | :remove="handleRemove" |
| | | :on-change="handleChange" |
| | | accept=".xlsx,.xls" |
| | | :limit="data.limit" |
| | | style="width: 230px" |
| | | > |
| | | <el-button type="primary"> 点击上传 </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleClose" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onUpload" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | |
| | | |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {InfoFilled} from '@element-plus/icons-vue' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {delCompany, getCompany} from "@/api/hazardousChemicals/company"; |
| | | import basicDialog from "./components/basicDialog.vue"; |
| | | import {delBasic, getBasicList} from "@/api/hazardousChemicals/basicInfo"; |
| | | import {delBasic, exportBasicInfo, getBasicList} from "@/api/hazardousChemicals/basicInfo"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | | const exportDialog = ref(false) |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | id:4, |
| | | name: '其他' |
| | | }, |
| | | ] |
| | | ], |
| | | fileList: [], |
| | | limit: 1 |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | |
| | | }) |
| | | } |
| | | |
| | | const exportData = () => { |
| | | exportDialog.value = true |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | data.fileList = [] |
| | | exportDialog.value = false |
| | | } |
| | | const downloadFile = () => { |
| | | const link = document.createElement('a') |
| | | link.href = 'files/hazard.xls' |
| | | link.target = '_blank' |
| | | link.download = '危化品基础信息模板.xlsx' |
| | | link.click() |
| | | } |
| | | const handleRemove = (file) => { |
| | | const index = data.fileList.indexOf(file) |
| | | const newFileList = data.fileList.slice() |
| | | newFileList.splice(index, 1) |
| | | data.fileList = newFileList; |
| | | } |
| | | |
| | | const f = ref() |
| | | const handleChange = (file,fileList) => { |
| | | console.log('file',file) |
| | | let fileExtension = file.name.split('.').pop(); |
| | | if(fileExtension == 'xls' || fileExtension == 'xlsx'){ |
| | | f.value = file.raw |
| | | }else { |
| | | data.fileList = [] |
| | | ElMessage.warning('仅可上传Execl文件') |
| | | } |
| | | } |
| | | const onUpload = async () => { |
| | | |
| | | if(!f.value){ |
| | | ElMessage.warning('请先上传危化品表格') |
| | | return; |
| | | }else{ |
| | | const formData = new FormData(); |
| | | formData.append('file', f.value) |
| | | |
| | | const res = await exportBasicInfo(formData) |
| | | if(res.code == 200){ |
| | | ElMessage.success('上传成功') |
| | | data.fileList = [] |
| | | exportDialog.value = false |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .app-container{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }) |
| | | |
| | | onMounted(()=>{ |
| | | if(Cookies.get('configInfo')){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config){ |
| | | showFinishPro.value = config.useProd === 1; |
| | | }else { |
| | | showFinishPro.value = true |
| | |
| | | productType: [{ required: true, message: '请输入试剂类型', trigger: 'blur' }], |
| | | manufacturer: [{ required: true, message: '请输入厂家', trigger: 'blur' }], |
| | | metering: [{ required: true, message: '请输入包装数量', trigger: 'blur' }], |
| | | perBox: [{ required: true, message: '请输入每箱数量', trigger: 'blur' }], |
| | | // perBox: [{ required: true, message: '请输入每箱数量', trigger: 'blur' }], |
| | | price: [{ required: true, message: '请输入含税价格', trigger: 'blur' }], |
| | | productSn: [{ required: true, validator: validateName, trigger: 'blur' }], |
| | | supplier: [{ required: true, message: '请输入供应商', trigger: 'blur' }], |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="display: flex;flex-direction: column"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | style="width: 70px;margin-bottom: 10px" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | <div style="display: flex"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | style="width: 70px;margin-bottom: 10px" |
| | | @click="openDialog('add',{})" |
| | | >新增</el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | style="width: 80px;margin-bottom: 10px" |
| | | @click="exportData" |
| | | >批量导入</el-button> |
| | | </div> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item label="名称:" > |
| | | <el-input v-model="data.queryParams.name" placeholder="请输入危化品名称"></el-input> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="含税售价" prop="price" align="center"/> |
| | | <el-table-column label="每箱数量" prop="perBox" align="center"/> |
| | | <el-table-column label="每箱数量" prop="perBox" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.perBox === 0 || scope.row.perBox === null ? '--' : scope.row.perBox}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="最小包装类型" prop="minPackage" align="center"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.minPackage == 0 ? '瓶' :scope.row.minPackage == 1?'袋':scope.row.minPackage == 2?'桶 ':scope.row.minPackage == 3?'盒':scope.row.minPackage == 4?'箱':'其他'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="安全库存" prop="safeNum" align="center"/>--> |
| | | <!-- <el-table-column label="超期阈值(小时)" prop="threshold" 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="openDialog('edit',scope.row)">编辑</el-button> |
| | |
| | | /> |
| | | |
| | | <basic-dialog ref="dialogRef" @getList=getList></basic-dialog> |
| | | <el-dialog |
| | | v-model="exportDialog" |
| | | title="批量导入成品" |
| | | width="500px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form size="default" ref="busRef" label-width="150px" > |
| | | <el-form-item label="成品表格模板:"> |
| | | <el-button type="primary" plain @click="downloadFile">下载模板</el-button> |
| | | </el-form-item> |
| | | <div style="color: #ed5565;margin-left: 33px;margin-top: -8px;margin-bottom: 18px"> |
| | | 导入成品基础数据须依据此模板 |
| | | </div> |
| | | <el-form-item label="成品表格文件:"> |
| | | <el-upload |
| | | :auto-upload="false" |
| | | action="#" |
| | | :file-list="data.fileList" |
| | | :remove="handleRemove" |
| | | :on-change="handleChange" |
| | | accept=".xlsx,.xls" |
| | | :limit="data.limit" |
| | | style="width: 230px" |
| | | > |
| | | <el-button type="primary"> 点击上传 </el-button> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="handleClose" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="onUpload" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | |
| | | |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {delCompany, getCompany} from "@/api/hazardousChemicals/company"; |
| | | import basicDialog from "./components/finishedBasicDialog.vue"; |
| | | import {delBasic, getBasicList} from "@/api/hazardousChemicals/basicInfo"; |
| | | import {delBasic, exportBasicInfo, getBasicList} from "@/api/hazardousChemicals/basicInfo"; |
| | | import {delFinishBasic, getFinishBasicList} from "@/api/hazardousChemicals/finishedBasicInfo"; |
| | | import {exportProductInfo} from "@/api/hazardousChemicals/productRecord"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | | const exportDialog = ref(false) |
| | | const data = reactive({ |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | id: 4, |
| | | name: '其他' |
| | | }, |
| | | ] |
| | | ], |
| | | fileList: [], |
| | | limit: 1 |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | |
| | | }) |
| | | } |
| | | |
| | | const handleClose = () => { |
| | | data.fileList = [] |
| | | exportDialog.value = false |
| | | } |
| | | const exportData = () => { |
| | | exportDialog.value = true |
| | | } |
| | | const downloadFile = () => { |
| | | const link = document.createElement('a') |
| | | link.href = 'files/product.xls' |
| | | link.target = '_blank' |
| | | link.download = '成品基础信息模板.xls' |
| | | link.click() |
| | | } |
| | | const f = ref() |
| | | const handleChange = (file,fileList) => { |
| | | console.log('file',file) |
| | | let fileExtension = file.name.split('.').pop(); |
| | | if(fileExtension == 'xls' || fileExtension == 'xlsx'){ |
| | | f.value = file.raw |
| | | }else { |
| | | data.fileList = [] |
| | | ElMessage.warning('仅可上传Execl文件') |
| | | } |
| | | } |
| | | const handleRemove = (file) => { |
| | | const index = data.fileList.indexOf(file) |
| | | const newFileList = data.fileList.slice() |
| | | newFileList.splice(index, 1) |
| | | data.fileList = newFileList; |
| | | } |
| | | |
| | | const onUpload = async () => { |
| | | |
| | | if(!f.value){ |
| | | ElMessage.warning('请先上传成品表格') |
| | | return; |
| | | }else{ |
| | | const formData = new FormData(); |
| | | formData.append('file', f.value) |
| | | |
| | | const res = await exportProductInfo(formData) |
| | | if(res.code == 200){ |
| | | ElMessage.success('上传成功') |
| | | data.fileList = [] |
| | | exportDialog.value = false |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .app-container{ |
| | | :deep(.el-form .el-form-item__label) { |
| | | font-size: 15px; |
| | | } |
| | | } |
| | | </style> |
| | | |
| | |
| | | import {reactive, ref, toRefs} from 'vue' |
| | | import {ElMessage} from "element-plus"; |
| | | import {addCompany, checkName, distributeCompany, editCompany} from "@/api/hazardousChemicals/company"; |
| | | import {verifyPhone} from "@/utils/validate"; |
| | | import {verifyPhone, verifyPwd} from "@/utils/validate"; |
| | | |
| | | const dialogVisible = ref(false); |
| | | const title = ref(""); |
| | |
| | | } |
| | | } |
| | | } |
| | | let validateCode = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入企业编码')) |
| | | }else{ |
| | | if(value.length !== 2){ |
| | | callback(new Error('请输入两位字母或者数字编码')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | |
| | | const state = reactive({ |
| | | form: { |
| | | id: '', |
| | |
| | | major:[{ required: true, message: '请输入负责人', trigger: 'blur' }], |
| | | name: [{ required: true, trigger: "blur", validator: validateName }], |
| | | phone:[{ required: true, trigger: "blur", validator: validatePhone }], |
| | | code:[{ required: true, message: '请输入企业编码', trigger: 'blur' }], |
| | | code:[{ required: true, validator: validateCode, trigger: 'blur' }], |
| | | }, |
| | | }) |
| | | |
| | |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="企业信用代码" prop="creditCode" align="center" /> |
| | | <el-table-column label="企业编码" prop="code" align="center" /> |
| | | <el-table-column label="企业名称" prop="name" align="center" /> |
| | | <el-table-column label="负责人" prop="major" align="center" /> |
| | | <el-table-column label="联系电话" prop="phone" align="center"/> |
| | |
| | | const res = await getWhProDetail(state.queryParams) |
| | | if(res.code == 200){ |
| | | state.dataList = res.data.list.map(item => { |
| | | return{ |
| | | ...item, |
| | | name: item.productBasic.name, |
| | | productSn: item.productBasic.productSn |
| | | } |
| | | return{ |
| | | ...item, |
| | | name: item.productBasic.name, |
| | | productSn: item.productBasic.productSn |
| | | } |
| | | }) |
| | | state.total = res.data.total |
| | | originalList.value = state.dataList |
| | |
| | | }) |
| | | |
| | | onMounted(()=>{ |
| | | if(Cookies.get('configInfo')){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config){ |
| | | showFinishPro.value = config.useProd === 1; |
| | | }else { |
| | | showFinishPro.value = true |
| | |
| | | import searchPng from "@/assets/images/login-search.png" |
| | | import logoPng from "@/assets/logo/logo1.png" |
| | | import back from "@/assets/images/logo22.png" |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | const userStore = useUserStore() |
| | | const route = useRoute(); |
| | |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | }else if(userInfo.userType === 1){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.companyMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | if(config){ |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.companyMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | }else { |
| | | sidebarRouters.value = menu.companyMenu |
| | | |
| | | } |
| | | }else { |
| | | ElMessage.warning('请联系管理员完善企业配置') |
| | | sidebarRouters.value = menu.companyMenu |
| | | } |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |
| | | }else if(userInfo.userType === 2){ |
| | | const config = JSON.parse(Cookies.get('configInfo')) |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.commonMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | if(config){ |
| | | if(config.useProd === 0){ |
| | | sidebarRouters.value = menu.commonMenu.filter(item => item.path != '/finishedBasicInfo') |
| | | }else { |
| | | sidebarRouters.value = menu.commonMenu |
| | | } |
| | | }else { |
| | | // ElMessage.warning('请联系管理员完善企业配置') |
| | | sidebarRouters.value = menu.commonMenu |
| | | } |
| | | Cookies.set('routers',JSON.stringify(sidebarRouters.value)) |