| | |
| | | VITE_APP_RESOURCE_API = 'http://192.168.2.16:9000/trainexam/' |
| | | |
| | | #董 |
| | | #VITE_APP_BASE_API = 'http://192.168.2.24:8083/api' |
| | | VITE_APP_BASE_API = 'http://192.168.2.24:8083/api' |
| | | |
| | | #贺 |
| | | VITE_APP_BASE_API = 'http://192.168.2.11:5812/api' |
| | | #VITE_APP_BASE_API = 'http://192.168.2.11:5812/api' |
| | | |
| | | #线上 |
| | | #VITE_APP_BASE_API = 'http://47.108.222.15:8001/api' |
对比新文件 |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | export function getUseStatistic(params) { |
| | | return request({ |
| | | url: '/statistic/hazmatUseStatistic', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
| | | |
| | | export function importBaiscUse(params) { |
| | | return request({ |
| | | url: '/statistic/importBaiscUse', |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |
| | | |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 25C14 19.4772 18.4772 15 24 15C29.5228 15 34 19.4772 34 25V41H14V25Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 5V8" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M35.8918 9.32823L33.9634 11.6264" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M42.2187 20.2873L39.2642 20.8083" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M5.78116 20.2874L8.73558 20.8083" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M12.1086 9.32802L14.037 11.6262" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 41H43" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M44 5H3.99998V17H44V5Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M3.99998 41.0301L16.1756 28.7293L22.7549 35.0301L30.7982 27L35.2786 31.368" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M44 16.1719V42.1719" stroke="#333" stroke-width="4" stroke-linecap="round"/><path d="M3.99998 16.1719V30.1719" stroke="#333" stroke-width="4" stroke-linecap="round"/><path d="M13.0155 43H44" stroke="#333" stroke-width="4" stroke-linecap="round"/><path d="M17 11H38" stroke="#333" stroke-width="4" stroke-linecap="round"/><path d="M9.99998 10.9966H11" stroke="#333" stroke-width="4" stroke-linecap="round"/></svg> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M24 5L2 43H46L24 5Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 35V36" stroke="#333" stroke-width="4" stroke-linecap="round"/><path d="M24 19.0005L24.0083 29" stroke="#333" stroke-width="4" stroke-linecap="round"/></svg> |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?><svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M34 24L18 24" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 18L18 24L24 30" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><circle cx="38" cy="24" r="4" fill="none" stroke="#333" stroke-width="4"/><path d="M40.706 13C39.9214 11.8109 39.0133 10.7105 38 9.71713C34.3925 6.18064 29.4509 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44C29.4509 44 34.3925 41.8194 38 38.2829C39.0133 37.2895 39.9214 36.1891 40.706 35" stroke="#333" stroke-width="4" stroke-linecap="round"/></svg> |
| | |
| | | { |
| | | path: '/warehouseManage', |
| | | name: 'warehouseManage', |
| | | meta: { title: '入库管理',icon: 'form',affix: true } |
| | | meta: { title: '入库管理',icon: 'warehousing',affix: true } |
| | | }, |
| | | { |
| | | path: '/electronicWarehouse', |
| | | name: 'electronicWarehouse', |
| | | meta: { title: '电子仓库',icon: 'build',affix: true } |
| | | }, |
| | | { |
| | | path: '/useCount', |
| | | name: 'useCount', |
| | | meta: { title: '用量统计',icon: 'analysis',affix: true } |
| | | }, |
| | | // { |
| | | // path: '/detailList', |
| | |
| | | { |
| | | path: '/overdueWarning', |
| | | name: 'overdueWarning', |
| | | meta: { title: '超期预警',icon: 'peoples',affix: true } |
| | | meta: { title: '超期预警',icon: 'alarm',affix: true } |
| | | }, |
| | | { |
| | | path: '/avoidWarning', |
| | | name: 'avoidWarning', |
| | | meta: { title: '危化品相忌报警',icon: 'form',affix: true } |
| | | meta: { title: '危化品相忌报警',icon: 'caution',affix: true } |
| | | }, |
| | | { |
| | | path: '/basicInfo', |
| | |
| | | { |
| | | path: '/warehouseManage', |
| | | name: 'warehouseManage', |
| | | meta: { title: '入库管理',icon: 'form',affix: true } |
| | | meta: { title: '入库管理',icon: 'warehousing',affix: true } |
| | | }, |
| | | { |
| | | path: '/electronicWarehouse', |
| | | name: 'electronicWarehouse', |
| | | meta: { title: '电子仓库',icon: 'build',affix: true } |
| | | }, |
| | | { |
| | | path: '/useCount', |
| | | name: 'useCount', |
| | | meta: { title: '用量统计',icon: 'analysis',affix: true } |
| | | }, |
| | | // { |
| | | // path: '/detailList', |
| | |
| | | { |
| | | path: '/overdueWarning', |
| | | name: 'overdueWarning', |
| | | meta: { title: '超期预警',icon: 'peoples',affix: true } |
| | | meta: { title: '超期预警',icon: 'alarm',affix: true } |
| | | }, |
| | | { |
| | | path: '/avoidWarning', |
| | | name: 'avoidWarning', |
| | | meta: { title: '危化品相忌报警',icon: 'form',affix: true } |
| | | meta: { title: '危化品相忌报警',icon: 'caution',affix: true } |
| | | }, |
| | | { |
| | | path: '/basicInfo', |
| | |
| | | ] |
| | | }, |
| | | { |
| | | path: '/useCount', |
| | | component: Layout, |
| | | redirect: '/useCount', |
| | | children: [ |
| | | { |
| | | path: '/useCount', |
| | | component: () => import('@/views/hazardousChemicals/useCount/index.vue'), |
| | | name: 'useCount', |
| | | meta: { title: '用量统计',icon: 'form', affix: true } |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/basicInfo', |
| | | component: Layout, |
| | | redirect: '/basicInfo', |
| | |
| | | <el-table-column label="时间" prop="createTime" align="center" /> |
| | | <el-table-column label="品名" prop="basicName" align="center" /> |
| | | <el-table-column label="相忌试剂" prop="tabooBasicName" align="center" /> |
| | | <el-table-column label="储存位置" align="center" > |
| | | <el-table-column label="储存位置" align="center" width="160"> |
| | | <template #default="scope"> |
| | | <span>{{scope.row.warehouseName}}——{{scope.row.cupboardName}}</span> |
| | | <span>{{scope.row.warehouseName}}—{{scope.row.cupboardName}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="当前位置" align="center" width="160"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.state == 1">{{scope.row.reWarehouseName}}—{{scope.row.reCupboardName}}</span> |
| | | <span v-else>—</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="风险等级" align="center" > |
| | |
| | | <el-table-column label="CAS" prop="cas" align="center"/> |
| | | <el-table-column label="试剂类型" prop="hazmatType" align="center"/> |
| | | <el-table-column label="危险性质" prop="hazmatCharacter" align="center" width="140"/> |
| | | <el-table-column label="危化品特性" prop="peculiarityType" align="center" width="140"/> |
| | | <!-- <el-table-column label="危化品特性" prop="peculiarityType" align="center" width="140"/>--> |
| | | <el-table-column label="危险性类别" prop="riskType" align="center" width="140"> |
| | | <template #default="scope"> |
| | | <div v-html="scope.row.riskType"></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="危化品分类编号" prop="peculiarityNumber" align="center" /> |
| | | <el-table-column label="供应商" prop="supplier" align="center"/> |
| | | <el-table-column label="厂家" prop="manufacturer" align="center"/> |
| | | <el-table-column label="规格" prop="hazmatFormat" align="center"/> |
| | |
| | | <el-table-column label="CAS" prop="cas" align="center"/> |
| | | <el-table-column label="试剂类型" prop="productType" align="center"/> |
| | | <el-table-column label="危险性质" prop="productCharacter" align="center"/> |
| | | <el-table-column label="危化品特性" prop="peculiarityType" align="center" width="140"/> |
| | | <!-- <el-table-column label="危化品特性" prop="peculiarityType" align="center" width="140"/>--> |
| | | <el-table-column label="危险性类别" prop="riskType" align="center" width="140"> |
| | | <template #default="scope"> |
| | | <div v-html="scope.row.riskType"></div> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="危化品分类编号" prop="peculiarityNumber" align="center" /> |
| | | <el-table-column label="供应商" prop="supplier" align="center"/> |
| | | <el-table-column label="厂家" prop="manufacturer" align="center"/> |
| | | <el-table-column label="规格" prop="productFormat" align="center"/> |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" > |
| | | <el-form-item label="按时间查询:" > |
| | | <el-date-picker |
| | | v-model="state.tableData.listQuery.time" |
| | | type="datetimerange" |
| | | range-separator="~" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | plain |
| | | type="primary" |
| | | @click="reset" |
| | | >重置</el-button> |
| | | <el-button |
| | | icon="Search" |
| | | type="primary" |
| | | @click="getList" |
| | | >查询</el-button> |
| | | |
| | | <!-- <vue3-json-excel--> |
| | | <!-- class="ml10"--> |
| | | <!-- :json-data="state.tableData.data"--> |
| | | <!-- :fields="fields"--> |
| | | <!-- :name="state.tableData.excelName"--> |
| | | <!-- >--> |
| | | <el-button type="primary" icon="Download" size="default" @click="downloadExcel">导出</el-button> |
| | | <!-- </vue3-json-excel>--> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <el-table v-loading="loading" :data="state.tableData.data" :border="true"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="危化品品名" prop="hazmatBasic.name" align="center" /> |
| | | <el-table-column label="CAS" prop="hazmatBasic.cas" align="center" /> |
| | | <el-table-column label="试剂类型" prop="hazmatBasic.hazmatType" align="center" /> |
| | | <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" /> |
| | | <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" width="180" /> |
| | | <el-table-column label="规格" prop="hazmatBasic.hazmatFormat" align="center"/> |
| | | <el-table-column label="最小包装类型" prop="" align="center" width="180" > |
| | | <template #default="scope"> |
| | | <span> {{scope.row.hazmatBasic.minPackage == 0 ? '瓶' :scope.row.hazmatBasic.minPackage == 1?'袋':scope.row.hazmatBasic.minPackage == 2?'桶 ':scope.row.hazmatBasic.minPackage == 3?'盒':scope.row.hazmatBasic.minPackage == 4?'箱':'其他'}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="用量" prop="count" align="center" /> |
| | | </el-table> |
| | | <pagination |
| | | v-show="state.tableData.total > 0" |
| | | :total="state.tableData.total" |
| | | v-model:page="state.tableData.listQuery.pageNum" |
| | | v-model:limit="state.tableData.listQuery.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {getUseStatistic, importBaiscUse} from "@/api/hazardousChemicals/useCount"; |
| | | import {ElMessage} from "element-plus"; |
| | | import moment from "moment"; |
| | | import axios from "axios"; |
| | | import {getToken} from "@/utils/auth"; |
| | | |
| | | const loading = ref(false) |
| | | const state = reactive({ |
| | | tableData: { |
| | | data: [], |
| | | total: 0, |
| | | loading: false, |
| | | listQuery: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | startTime: null, |
| | | endTime: null, |
| | | time: [], |
| | | }, |
| | | excelName: '' |
| | | }, |
| | | }); |
| | | const fields = ref({ |
| | | '名称':'hazmatBasic.name', |
| | | 'CAS': 'hazmatBasic.cas', |
| | | '试剂类型':'hazmatBasic.hazmatType', |
| | | '危险性质':'hazmatBasic.hazmatCharacter', |
| | | '供应商':'hazmatBasic.supplier', |
| | | '规格':'hazmatBasic.hazmatFormat', |
| | | '最小包装': 'minPack', |
| | | '用量':'count', |
| | | }); |
| | | |
| | | onMounted( |
| | | () => { |
| | | getNowTime(); |
| | | getList() |
| | | } |
| | | ); |
| | | const getNowTime = () => { |
| | | let isDate = new Date() |
| | | let sTime = `${isDate.getFullYear()}-${isDate.getMonth()}-${isDate.getDate()}` |
| | | let eTime = `${isDate.getFullYear()}-${isDate.getMonth()+1}-${isDate.getDate()}` |
| | | sTime = `${sTime} 00:00:00` |
| | | eTime = `${eTime} ` + moment().format('HH:mm:ss') |
| | | state.tableData.listQuery.time = [sTime ,eTime]; |
| | | } |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | state.tableData.listQuery.startTime = state.tableData.listQuery.time[0] |
| | | state.tableData.listQuery.endTime = state.tableData.listQuery.time[1] |
| | | const {time, ...data} = JSON.parse(JSON.stringify(state.tableData.listQuery)) |
| | | const res = await getUseStatistic(data) |
| | | if(res.code == 200){ |
| | | state.tableData.data = res.data.list.map(item => { |
| | | return { |
| | | ...item, |
| | | minPack: `${item.hazmatBasic.metering}${item.hazmatBasic.unit}/${item.hazmatBasic.minPackage == 0 ? '瓶' : item.hazmatBasic.minPackage == 1?'袋':item.hazmatBasic.minPackage == 2?'桶 ':item.hazmatBasic.minPackage == 3?'盒':item.hazmatBasic.minPackage == 4?'箱':'其他'}` |
| | | } |
| | | }) |
| | | console.log('1',state.tableData.data) |
| | | state.tableData.total = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false |
| | | } |
| | | const downloadExcel = async() => { |
| | | |
| | | state.tableData.listQuery.startTime = moment(state.tableData.listQuery.time[0]).format('YYYY-MM-DD HH:mm:ss').substring(0,10) |
| | | state.tableData.listQuery.endTime = moment(state.tableData.listQuery.time[1]).format('YYYY-MM-DD HH:mm:ss').substring(0,10) |
| | | console.log('time', state.tableData.listQuery.startTime, state.tableData.listQuery.endTime) |
| | | state.tableData.excelName = state.tableData.listQuery.startTime + '至' +state.tableData.listQuery.endTime + '__用量统计.xls' |
| | | // state.tableData.listQuery.startTime = state.tableData.listQuery.time[0] |
| | | // state.tableData.listQuery.endTime = state.tableData.listQuery.time[1] |
| | | const data = { |
| | | startTime:state.tableData.listQuery.startTime, |
| | | endTime: state.tableData.listQuery.endTime |
| | | } |
| | | const url = import.meta.env.VITE_APP_BASE_API + '/statistic/importBaiscUse' |
| | | axios( |
| | | { |
| | | method: 'get', |
| | | url: url, |
| | | responseType: 'blob', |
| | | params: data, |
| | | headers: { 'Authorization':getToken() } |
| | | } |
| | | ).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", state.tableData.excelName); |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | document.body.removeChild(link); |
| | | }else { |
| | | ElMessage.warning('获取文件失败') |
| | | } |
| | | }) |
| | | // const res = await importBaiscUse(data) |
| | | // if(res.code == 200){ |
| | | // 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",state.tableData.excelName ); |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); |
| | | // }else{ |
| | | // ElMessage.warning(res.message) |
| | | // } |
| | | |
| | | } |
| | | const reset = () => { |
| | | getNowTime(); |
| | | getList(); |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | </style> |
| | |
| | | <el-form-item label="产品编号:" > |
| | | <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仓库:" prop="warehouseName" > |
| | | <el-select |
| | | clearable |
| | | v-model="data.queryParams.params.warehouseName" |
| | | filterable |
| | | remote |
| | | reserve-keyword |
| | | placeholder="请输入所入仓库" |
| | | remote-show-suffix |
| | | :remote-method="getWareHouseList" |
| | | style="width: 100%" |
| | | @change="selectWareValue" |
| | | > |
| | | <el-option |
| | | v-for="item in data.wareHouseList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="存储柜:" prop="cupboardId" > |
| | | <el-select |
| | | clearable |
| | | v-model="data.queryParams.params.cupboardId" |
| | | placeholder="请选择存储柜" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in data.cupList" |
| | | :key="item.id" |
| | | :label="item.cupboardName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import proDialog from "./addProDialog.vue"; |
| | | import printcode from './printCode.vue' |
| | | import {delWarehouse, getWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | import {delWarehouse, getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | import { |
| | | delProductRecord, |
| | | doEntryPro, |
| | |
| | | pageSize: 10, |
| | | params :{ |
| | | name: '', |
| | | productSn: '' |
| | | productSn: '', |
| | | cupboardId: null, |
| | | warehouseId: null |
| | | } |
| | | }, |
| | | total: 0, |
| | | dataList: [] |
| | | dataList: [], |
| | | wareHouseList: [], |
| | | cupList: [] |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | | getList() |
| | | getWareHouseList("") |
| | | }) |
| | | |
| | | const getList = async () => { |
| | |
| | | pageSize: 10, |
| | | params :{ |
| | | name: '', |
| | | productSn: '' |
| | | productSn: '', |
| | | cupboardId: null, |
| | | warehouseId: null |
| | | } |
| | | } |
| | | data.cupList = [] |
| | | getList() |
| | | getWareHouseList("") |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | |
| | | const v = JSON.stringify(obj) |
| | | router.push({ path: "/whProDetail", query: { val: v } }); |
| | | } |
| | | const getWareHouseList = async (val) => { |
| | | let param = {} |
| | | if(val != ""){ |
| | | param = { |
| | | name: val |
| | | } |
| | | }else { |
| | | param = { |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | } |
| | | } |
| | | const res = await getWarehouse(param) |
| | | if(res.code == 200){ |
| | | data.wareHouseList = res.data.list |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const selectWareValue = (val) => { |
| | | data.queryParams.params.cupboardId = null |
| | | data.wareHouseList.forEach(item => { |
| | | if(item.name === val){ |
| | | data.queryParams.params.warehouseId = item.id |
| | | getCupList(item.id) |
| | | } |
| | | }) |
| | | } |
| | | const getCupList = async (val) => { |
| | | const res = await getCupById(val) |
| | | if(res.code == 200) { |
| | | data.cupList = res.data |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | defineExpose({ |
| | | getList |
| | |
| | | <el-form-item label="产品编号:" > |
| | | <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="仓库:" prop="warehouseName" > |
| | | <el-select |
| | | clearable |
| | | v-model="data.queryParams.params.warehouseName" |
| | | filterable |
| | | remote |
| | | reserve-keyword |
| | | placeholder="请输入所入仓库" |
| | | remote-show-suffix |
| | | :remote-method="getWareHouseList" |
| | | style="width: 100%" |
| | | @change="selectWareValue" |
| | | > |
| | | <el-option |
| | | v-for="item in data.wareHouseList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="存储柜:" prop="cupboardId" > |
| | | <el-select |
| | | clearable |
| | | v-model="data.queryParams.params.cupboardId" |
| | | placeholder="请选择存储柜" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | |
| | | v-for="item in data.cupList" |
| | | :key="item.id" |
| | | :label="item.cupboardName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item > |
| | | <el-button |
| | | type="primary" |
| | |
| | | import printcode from './printCode.vue' |
| | | import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | import {getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | |
| | | pageSize: 10, |
| | | params :{ |
| | | name: '', |
| | | productSn: '' |
| | | productSn: '', |
| | | cupboardId: null, |
| | | warehouseId: null |
| | | } |
| | | }, |
| | | total: 0, |
| | | dataList: [] |
| | | dataList: [], |
| | | wareHouseList: [], |
| | | cupList: [] |
| | | |
| | | }); |
| | | |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | | getList() |
| | | getWareHouseList("") |
| | | }) |
| | | |
| | | const getList = async () => { |
| | |
| | | pageSize: 10, |
| | | params :{ |
| | | name: '', |
| | | productSn: '' |
| | | productSn: '', |
| | | cupboardId: null, |
| | | warehouseId: null |
| | | } |
| | | } |
| | | data.cupList = [] |
| | | getList() |
| | | getWareHouseList("") |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | |
| | | router.push({ path: "/whRawDetail", query: { val: v } }); |
| | | } |
| | | |
| | | const getWareHouseList = async (val) => { |
| | | let param = {} |
| | | if(val != ""){ |
| | | param = { |
| | | name: val |
| | | } |
| | | }else { |
| | | param = { |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | } |
| | | } |
| | | const res = await getWarehouse(param) |
| | | if(res.code == 200){ |
| | | data.wareHouseList = res.data.list |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | const selectWareValue = (val) => { |
| | | data.queryParams.params.cupboardId = null |
| | | data.wareHouseList.forEach(item => { |
| | | if(item.name === val){ |
| | | data.queryParams.params.warehouseId = item.id |
| | | getCupList(item.id) |
| | | } |
| | | }) |
| | | } |
| | | const getCupList = async (val) => { |
| | | const res = await getCupById(val) |
| | | if(res.code == 200) { |
| | | data.cupList = res.data |
| | | }else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | |
| | | defineExpose({ |
| | | getList |