zhouwx
2024-08-19 cd84a28754fc1b3fadb7027245333d6d3ff330a3
bug修改
已修改27个文件
已添加7个文件
1165 ■■■■ 文件已修改
src/api/hazardousChemicals/count.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/hazardousChemicals/productRecord.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/hazardousChemicals/rawRecord.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/hazmat.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/used.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/warehouse.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/warning.png 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/logo/warning1.png 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/flowDetail.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/accessRecords/components/productTable.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/accessRecords/components/rawTable.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/accessRecords/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/basicInfon/components/basicDialog.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/basicInfon/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/electronicWarehouse/components/proDetail.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/electronicWarehouse/components/productTable.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/electronicWarehouse/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/finishedBasicInfo/index.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/homePage/index.vue 206 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/overdueWarning/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/systemManage/user/components/userDialog.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/systemManage/user/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/addProDialog.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/addRawDialog.vue 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/printCode.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/proDetail.vue 176 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/productTable.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/components/rawTable.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/hazardousChemicals/warehouseManage/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/hazardousChemicals/count.js
@@ -36,3 +36,11 @@
        data: params
    })
}
export function unWarningCount() {
    return request({
        url: '/warning/warningCount',
        method: 'get',
    })
}
src/api/hazardousChemicals/productRecord.js
@@ -93,3 +93,11 @@
        params: params
    })
}
export function getWhProDetail(params) {
    return request({
        url: '/product-entry-record/productlist',
        method: 'get',
        params: params
    })
}
src/api/hazardousChemicals/rawRecord.js
@@ -95,3 +95,11 @@
}
export function getWhRawDetail(params) {
    return request({
        url: '/entry-record/hazmatlist',
        method: 'get',
        params: params
    })
}
src/assets/logo/hazmat.png
src/assets/logo/used.png
src/assets/logo/warehouse.png
src/assets/logo/warning.png
src/assets/logo/warning1.png
src/router/index.js
@@ -118,6 +118,32 @@
    ]
  },
  {
    path: '/whRawDetail',
    component: Layout,
    redirect: '/whRawDetail',
    children: [
      {
        path: '/whRawDetail',
        component: () => import('@/views/hazardousChemicals/warehouseManage/components/rawDetail.vue'),
        name: 'whRawDetail',
        meta: { title: '危化品详情',icon: 'form',  affix: true }
      }
    ]
  },
  {
    path: '/whProDetail',
    component: Layout,
    redirect: '/whProDetail',
    children: [
      {
        path: '/whProDetail',
        component: () => import('@/views/hazardousChemicals/warehouseManage/components/proDetail.vue'),
        name: 'whProDetail',
        meta: { title: '成品详情',icon: 'form',  affix: true }
      }
    ]
  },
  {
    path: '/accessRecords',
    component: Layout,
    redirect: '/accessRecords',
src/views/components/flowDetail.vue
@@ -79,7 +79,7 @@
          return {
            ...item,
            unit: item.productBasic.unit,
            description: `${item.updateTime} ${item.user.departName}部门   ${item.user.name}  进行了  ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`,
            description: `${item.updateTime}   ${item.user.departName ? item.user.departName +'部门'  : ''}   ${item.user.name}  进行了  ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`,
            size: 'large',
            type: 'primary',
            icon: MoreFilled,
@@ -113,7 +113,7 @@
          return {
            ...item,
            unit:item.hazmatBasic.unit,
            description: `${item.updateTime} ${item.user.departName}部门   ${item.user.name}  进行了  ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`,
            description: `${item.updateTime}  ${item.user.departName ? item.user.departName +'部门'  : ''}   ${item.user.name}  进行了  ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`,
            size: 'large',
            type: 'primary',
            icon: MoreFilled,
@@ -141,7 +141,7 @@
            return {
              ...item,
              unit:item.hazmatBasic.unit,
              description: `${item.updateTime} ${item.user.departName}部门   ${item.user.name}  进行了  ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`,
              description: `${item.updateTime}  ${item.user.departName ? item.user.departName +'部门'  : ''}   ${item.user.name}  进行了  ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''}`,
              size: 'large',
              type: 'primary',
              icon: MoreFilled,
@@ -156,7 +156,7 @@
            return {
              ...item,
              unit:item.productBasic.unit,
              description: `${item.updateTime} ${item.user.departName}部门   ${item.user.name}  进行了  ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`,
              description: `${item.updateTime}  ${item.user.departName? item.user.departName  +'部门'  : ''}   ${item.user.name}  进行了  ${item.state == 0 ? '批量导入' : item.state == 3 ? '标签作废' : '销售'}`,
              size: 'large',
              type: 'primary',
              icon: MoreFilled,
src/views/hazardousChemicals/accessRecords/components/productTable.vue
@@ -3,10 +3,10 @@
    <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-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -88,8 +88,10 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -122,8 +124,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
src/views/hazardousChemicals/accessRecords/components/rawTable.vue
@@ -3,10 +3,10 @@
    <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-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -91,8 +91,10 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -132,8 +134,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
src/views/hazardousChemicals/accessRecords/index.vue
@@ -1,11 +1,11 @@
<template>
  <div>
    <el-tabs v-model="data.activeName" class="demo-tabs" @click="clickTab" style="margin: 10px 10px">
    <el-tabs v-model="data.activeName" class="demo-tabs" @tab-click="clickTab" style="margin: 10px 10px">
      <el-tab-pane label="危化品" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
      <el-tab-pane label="成品" name="finishPro" v-if="showFinishPro">
        <pro-table ref="proRef"></pro-table>
      </el-tab-pane>
      <el-tab-pane label="原材料" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
    </el-tabs>
  </div>
@@ -22,15 +22,16 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
  },
  total: 0,
  dataList: [],
  activeName: 'finishPro'
  activeName: 'rawMaterial'
})
onMounted(()=>{
  showFinishPro.value = true;
  data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
  // data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
})
const clickTab = (tab,event) =>{
  console.log('tab',data.activeName)
src/views/hazardousChemicals/basicInfon/components/basicDialog.vue
@@ -34,10 +34,35 @@
          <el-input v-model.trim="state.form.cas" placeholder="请输入CAS"></el-input>
        </el-form-item>
        <el-form-item label="试剂类型:" prop="hazmatType">
          <el-input v-model.trim="state.form.hazmatType" placeholder="请输入试剂类型"></el-input>
          <el-select
              v-model="state.form.hazmatType"
              placeholder="请选择试剂类型"
              clearable
              style="width: 100%"
          >
            <el-option
                v-for="dict in state.hazmatTypeList"
                :key="dict.id"
                :label="dict.name"
                :value="dict.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="危险性质:" prop="hazmatCharacter">
          <el-input v-model.trim="state.form.hazmatCharacter" placeholder="请输入危险性质"></el-input>
          <el-select
              v-model="state.characterList"
              placeholder="请选择危险性质"
              clearable
              multiple
              style="width: 100%"
          >
            <el-option
                v-for="dict in state.hazmatCharacterList"
                :key="dict.id"
                :label="dict.name"
                :value="dict.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="供应商:" prop="supplier">
          <el-input v-model.trim="state.form.supplier" placeholder="请输入供应商"></el-input>
@@ -94,7 +119,7 @@
          <el-input v-model.trim="state.form.safeNum" placeholder="请输入安全库存" oninput="value=value.replace(/^\.+|[^\d]/g,'')"></el-input>
        </el-form-item>
        <el-form-item label="超期阈值(小时):" prop="threshold">
          <el-input v-model.trim="state.form.threshold" placeholder="请输入超期阈值"></el-input>
          <el-input v-model.trim="state.form.threshold" placeholder="请输入超期阈值" oninput="value=value.replace(/^\.+|[^\d]/g,'')"></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
@@ -166,6 +191,7 @@
    threshold: null,
    kind: ''
  },
  characterList: [],
  formRules:{
    name: [{ required: true, trigger: "blur", message: '请输入危化品名称', }],
    cas: [{ required: true, message: '请输入cas', trigger: 'blur' }],
@@ -207,6 +233,28 @@
      name: '其他'
    },
  ],
  hazmatTypeList: [
    {
      id: 0,
      name: '耗材'
    },
    {
      id: 1,
      name: '液态'
    },
    {
      id: 2,
      name: '液体'
    },
    {
      id: 3,
      name: '气态'
    },
    {
      id: 4,
      name: '固态'
    },
  ],
  unitList:[
    {
      id: 0,
@@ -233,14 +281,44 @@
      name: '其他'
    },
  ],
  hazmatCharacterList: [
    {
      id: 0,
      name: '腐蚀品'
    },
    {
      id: 1,
      name: '氧化品'
    },
    {
      id: 2,
      name: '有毒品'
    },
    {
      id: 3,
      name: '易燃品'
    },
    {
      id: 4,
      name: '非易燃品'
    },
  ],
  unitOptions: [
    {
      value: 'g',
      label: 'g',
    },
    {
      value: 'mg',
      label: 'mg',
    },
    {
      value: 'ml',
      label: 'ml',
    },
    {
      value: 'l',
      label: 'l',
    },
  ]
})
@@ -251,12 +329,14 @@
  title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '' ;
  if(type === 'edit' || type === 'distribute') {
    state.form = value;
    state.characterList = state.form.hazmatCharacter.split(',')
    startUsername.value = value.productSn
  }
  dialogVisible.value = true;
}
const onSubmit = async () => {
  state.form.hazmatCharacter = state.characterList.join(",")
  const valid = await busRef.value.validate();
  if(valid){
    if(title.value === '新增'){
@@ -318,6 +398,7 @@
    threshold: null,
    kind: ''
  }
  state.characterList = []
}
defineExpose({
  openDialog
src/views/hazardousChemicals/basicInfon/index.vue
@@ -61,10 +61,10 @@
      <el-table-column label="产品编号" prop="productSn" 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"/>
      <el-table-column label="危险性质" prop="hazmatCharacter" align="center" width="140"/>
      <el-table-column label="供应商" prop="supplier" align="center"/>
      <el-table-column label="厂家" prop="manufacturer" align="center"/>
      <el-table-column label="规格" prop="hazmatCharacter" align="center"/>
      <el-table-column label="规格" prop="hazmatFormat" align="center"/>
      <el-table-column label="包装" prop="metering" align="center">
        <template #default="scope">
          <span>{{scope.row.metering}}{{scope.row.unit}}</span>
@@ -122,23 +122,23 @@
  dataList: [],
  typeList: [
    {
      id: 1,
      id: 0,
      name: '试剂'
    },
    {
      id: 2,
      id: 1,
      name: '原料'
    },
    {
      id: 3,
      id: 2,
      name: '半成品'
    },
    {
      id: 4,
      id: 3,
      name: '成品'
    },
    {
      id: 5,
      id:4,
      name: '其他'
    },
  ]
src/views/hazardousChemicals/electronicWarehouse/components/proDetail.vue
@@ -44,7 +44,7 @@
      <el-table-column label="CAS号" prop="productBasic.cas" align="center" />
      <el-table-column label="厂家" prop="productBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="productBasic.supplier" align="center" />
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
      <el-table-column label="二维码编号" prop="code" align="center" width="120" />
      <el-table-column label="危险性质" prop="productBasic.productCharacter" align="center" />
      <el-table-column label="最小包装" prop="productBasic.productSn" align="center" width="120">
        <template #default="scope">
src/views/hazardousChemicals/electronicWarehouse/components/productTable.vue
@@ -3,10 +3,10 @@
    <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-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -35,15 +35,16 @@
          <span>{{scope.row.productBasic.metering}}{{scope.row.productBasic.unit}} / {{scope.row.productBasic.minPackage == 0 ? '瓶' :scope.row.productBasic.minPackage == 1?'袋':scope.row.productBasic.minPackage == 2?'桶 ':scope.row.productBasic.minPackage == 3?'盒':scope.row.productBasic.minPackage == 4?'箱':'其他'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
<!--      <el-table-column label="批号" prop="batchNo" align="center" width="120" />-->
      <el-table-column label="当前库存" prop="stock" align="center" width="120" />
      <el-table-column label="所在仓库" prop="warehouseName" align="center" >
      </el-table-column>
      <el-table-column label="状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" prop="productBasic.createTime" align="center" width="120" />
<!--      <el-table-column label="状态" prop="state" align="center">-->
<!--        <template #default="scope">-->
<!--          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" >
        <template #default="scope">
          <el-button link type="primary" @click="getProRecord(scope.row)" >动库记录</el-button>
@@ -85,8 +86,10 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -126,8 +129,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue
@@ -44,7 +44,7 @@
      <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />
      <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
      <el-table-column label="二维码编号" prop="code" align="center" width="120" />
      <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />
      <el-table-column label="最小包装" prop="hazmatBasic.productSn" align="center" width="120">
        <template #default="scope">
@@ -54,12 +54,12 @@
      <el-table-column label="入库时间" prop="updateTime" align="center" />
      <el-table-column label="当前状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state ===0 ? '在库' : scope.row.state === 1 ? '领用归还在库' :scope.row.state === 2? '领用中': scope.row.state === 3 ? '已用完' : scope.row.state === 4 ? '标签作废' : ''}}</span>
          <span>{{scope.row.state ===0 || scope.row.state === 1 ? '在库' : scope.row.state === 2 ? '领用中': scope.row.state === 3 ? '已用完' : scope.row.state === 4 ? '标签作废' : ''}}</span>
        </template>
      </el-table-column>
      <el-table-column label="在库余量" prop="remaining" align="center" >
        <template #default="scope">
          <span v-if="scope.row.state === 0">{{scope.row.remaining}}{{scope.row.hazmatBasic.unit}}</span>
          <span v-if="scope.row.state === 0 || scope.row.state === 1">{{scope.row.remaining}}{{scope.row.hazmatBasic.unit}}</span>
          <span v-else>—</span>
        </template>
      </el-table-column>
src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue
@@ -3,10 +3,10 @@
    <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-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -35,17 +35,18 @@
          <span>{{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{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="batchNo" align="center" width="120" />
<!--      <el-table-column label="批号" prop="batchNo" align="center" width="120" />-->
      <el-table-column label="当前库存" prop="stock" align="center" width="120" />
      <el-table-column label="不完整归还" prop="missStock" align="center" width="120" />
      <el-table-column label="安全库存" prop="hazmatBasic.safeNum" align="center" width="120" />
      <el-table-column label="所在仓库" prop="warehouseName" align="center" >
      </el-table-column>
      <el-table-column label="状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" prop="hazmatBasic.createTime" align="center" width="120" />
<!--      <el-table-column label="状态" prop="state" align="center">-->
<!--        <template #default="scope">-->
<!--          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
        <template #default="scope">
          <el-button link type="primary"  @click="getProRecord(scope.row)" >动库记录</el-button>
@@ -88,8 +89,10 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -135,8 +138,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
@@ -184,7 +189,7 @@
  }
  for (var i = 0; i <= arr.length; i++) {
    if (arr[i] == row.basicId) {
      if (columnIndex === 9 || columnIndex === 10 || columnIndex === 11){
      if (columnIndex === 8 || columnIndex === 9 || columnIndex === 10){
        return { backgroundColor: '#FFD7CC !important',color:' red' }
      }
src/views/hazardousChemicals/electronicWarehouse/index.vue
@@ -1,11 +1,11 @@
<template>
  <div>
    <el-tabs v-model="data.activeName" class="demo-tabs" @click="clickTab" style="margin: 10px 10px">
    <el-tabs v-model="data.activeName" class="demo-tabs" @tab-click="clickTab" style="margin: 10px 10px">
      <el-tab-pane label="危化品" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
      <el-tab-pane label="成品" name="finishPro" v-if="showFinishPro">
        <pro-table ref="proRef"></pro-table>
      </el-tab-pane>
      <el-tab-pane label="原材料" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
    </el-tabs>
  </div>
@@ -26,7 +26,7 @@
  },
  total: 0,
  dataList: [],
  activeName: 'finishPro'
  activeName: 'rawMaterial'
})
onMounted(()=>{
@@ -34,7 +34,7 @@
  if(Cookies.get('type')){
    data.activeName = showFinishPro.value && Cookies.get('type') ==='pro' ? 'finishPro' : 'rawMaterial'
  }else{
    data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
    // data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
  }
})
src/views/hazardousChemicals/finishedBasicInfo/components/finishedBasicDialog.vue
@@ -34,10 +34,35 @@
          <el-input v-model.trim="state.form.cas" placeholder="请输入CAS"></el-input>
        </el-form-item>
        <el-form-item label="试剂类型:" prop="productType">
          <el-input v-model.trim="state.form.productType" placeholder="请输入试剂类型"></el-input>
          <el-select
              v-model="state.form.productType"
              placeholder="请选择试剂类型"
              clearable
              style="width: 100%"
          >
            <el-option
                v-for="dict in state.hazmatTypeList"
                :key="dict.id"
                :label="dict.name"
                :value="dict.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="危险性质:" prop="productCharacter">
          <el-input v-model.trim="state.form.productCharacter" placeholder="请输入危险性质"></el-input>
          <el-select
              v-model="state.characterList"
              placeholder="请选择危险性质"
              clearable
              multiple
              style="width: 100%"
          >
            <el-option
                v-for="dict in state.hazmatCharacterList"
                :key="dict.id"
                :label="dict.name"
                :value="dict.name"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="供应商:" prop="supplier">
          <el-input v-model.trim="state.form.supplier" placeholder="请输入供应商"></el-input>
@@ -167,6 +192,7 @@
    threshold: null,
    kind: ''
  },
  characterList: [],
  formRules:{
    name: [{ required: true, trigger: "blur", message: '请输入危化品名称', }],
    cas: [{ required: true, message: '请输入cas', trigger: 'blur' }],
@@ -234,14 +260,66 @@
      name: '其他'
    },
  ],
  hazmatTypeList: [
    {
      id: 0,
      name: '耗材'
    },
    {
      id: 1,
      name: '液态'
    },
    {
      id: 2,
      name: '液体'
    },
    {
      id: 3,
      name: '气态'
    },
    {
      id: 4,
      name: '固态'
    },
  ],
  hazmatCharacterList: [
    {
      id: 0,
      name: '腐蚀品'
    },
    {
      id: 1,
      name: '氧化品'
    },
    {
      id: 2,
      name: '有毒品'
    },
    {
      id: 3,
      name: '易燃品'
    },
    {
      id: 4,
      name: '非易燃品'
    },
  ],
  unitOptions: [
    {
      value: 'g',
      label: 'g',
    },
    {
      value: 'mg',
      label: 'mg',
    },
    {
      value: 'ml',
      label: 'ml',
    },
    {
      value: 'l',
      label: 'l',
    },
  ]
})
@@ -252,12 +330,14 @@
  title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑' : '' ;
  if(type === 'edit' || type === 'distribute') {
    state.form = value;
    state.characterList = state.form.productCharacter.split(',')
    startUsername.value = value.productSn
  }
  dialogVisible.value = true;
}
const onSubmit = async () => {
  state.form.productCharacter = state.characterList.join(",")
  const valid = await busRef.value.validate();
  if(valid){
    if(title.value === '新增'){
@@ -319,6 +399,7 @@
    threshold: null,
    kind: ''
  }
  state.characterList = []
}
defineExpose({
  openDialog
src/views/hazardousChemicals/finishedBasicInfo/index.vue
@@ -64,7 +64,7 @@
      <el-table-column label="危险性质" prop="productCharacter" align="center"/>
      <el-table-column label="供应商" prop="supplier" align="center"/>
      <el-table-column label="厂家" prop="manufacturer" align="center"/>
      <el-table-column label="规格" prop="productCharacter" align="center"/>
      <el-table-column label="规格" prop="productFormat" align="center"/>
      <el-table-column label="包装" prop="metering" align="center">
        <template #default="scope">
          <span>{{scope.row.metering}}{{scope.row.unit}}</span>
@@ -123,23 +123,23 @@
  dataList: [],
  typeList: [
    {
      id: 1,
      id: 0,
      name: '试剂'
    },
    {
      id: 2,
      id: 1,
      name: '原料'
    },
    {
      id: 3,
      id: 2,
      name: '半成品'
    },
    {
      id: 4,
      id: 3,
      name: '成品'
    },
    {
      id: 5,
      id: 4,
      name: '其他'
    },
  ]
src/views/hazardousChemicals/homePage/index.vue
@@ -43,65 +43,51 @@
      </el-row>
    </div>
    <div>
      <el-row :gutter="20" justify="space-between" style="margin-bottom: 15px">
        <el-col :xl="12" :lg="12" :md="24" :sm="24" :xs="24">
          <el-card>
            <span style="font-size: 18px;font-weight: 600;margin-left: 45%">超期预警</span>
            <el-table height="320" v-loading="data.wloading" :data="data.warningData" style="margin-top: 15px">
              <el-table-column label="序号" type="index" align="center" width="80" />
              <el-table-column label="生成时间" prop="createTime" align="center"  />
              <el-table-column label="领用人" prop="createName" align="center" />
              <el-table-column label="领用时间" prop="useTime" align="center" />
              <el-table-column label="最后流转时间" prop="updateTime" align="center" width="180"  />
              <el-table-column label="处理时间" prop="handleTime" align="center" />
              <el-table-column label="状态" prop="name" align="center" >
                <template #default="scope">
                  <span>{{scope.row.state === 0 ? '未处理':'已处理'}}</span>
                </template>
              </el-table-column>
            </el-table>
            <pagination
                :total="data.wTotal"
                v-model:page="data.warningQueryParams.pageNum"
                v-model:limit="data.warningQueryParams.pageSize"
                @pagination="getWarningData"
            />
      <el-row :gutter="20" justify="space-between" >
        <el-col :xl="12" :lg="12" :md="24" :sm="24" :xs="24" style="margin-bottom: 15px">
          <el-card style="height: 500px;overflow: auto">
              <span style="font-size: 18px;font-weight: 600;margin-bottom: -5px">危化品动态</span>
              <el-divider style="margin: 15px 0"></el-divider>
              <div style="padding: 10px;" v-if="data.hazmatData && data.hazmatData.length >0">
                <div v-for="(item,index) in data.hazmatData" :key="index" style="display: flex;flex-direction: column">
                  <div style="display: flex">
                    <img :src="avator" style="width: 25px;height: 25px" />
                    <div style="display: flex;flex-direction: column;margin-left: 20px">
                      <span style="font-size: 16px;font-weight: 600">{{item.description}}&nbsp;
                        <span style="color: #03752e" v-if="item.num > 0">{{item.num >0 ? '+' + item.num: item.num}}{{item.unit}}</span>
                        <span style="color: #f6828e" v-else>{{item.num}}{{item.unit}}</span>
                      </span>
                      <span style="font-size: 14px;color: #8a8f97;margin-top: 5px">{{item.updateTime}}</span>
                    </div>
                  </div>
                  <el-divider style="margin: 15px 0" v-if="index != data.hazmatData.length-1"></el-divider>
                </div>
              </div>
            <div v-else>
              <el-empty description="暂无数据" style="margin-top: 10%"></el-empty>
            </div>
          </el-card>
        </el-col>
        <el-col :xl="12" :lg="12" :md="24" :sm="24" :xs="24">
          <el-card>
            <span style="font-size: 18px;font-weight: 600;margin-left: 45%">危化品使用</span>
            <el-table height="320" v-loading="data.hloading" :data="data.hazmatData" style="margin-top: 15px">
              <el-table-column label="名称" prop="name" align="center" />
              <el-table-column label="产品编号" prop="hazmatBasic.productSn" 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"/>
              <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center"/>
              <el-table-column label="规格" prop="hazmatBasic.hazmatCharacter" align="center"/>
              <el-table-column label="包装" prop="hazmatBasic.metering" align="center">
                <template #default="scope">
                  <span>{{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}}</span>
                </template>
              </el-table-column>
              <el-table-column label="含税售价" prop="hazmatBasic.price" align="center"/>
              <el-table-column label="每箱数量" prop="hazmatBasic.perBox" align="center"/>
              <el-table-column label="最小包装类型" prop="minPackage" align="center" width="220">
                <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="hazmatBasic.safeNum" align="center"/>
              <el-table-column label="超期阈值(小时)" prop="hazmatBasic.threshold" align="center" width="220"/>
            </el-table>
            <pagination
                :total="data.hTotal"
                v-model:page="data.hazmatQueryParams.pageNum"
                v-model:limit="data.hazmatQueryParams.pageSize"
                @pagination="getHazmatUseData"
            />
          <el-card style="height: 500px;overflow: auto">
            <span style="font-size: 18px;font-weight: 600;margin-bottom: -5px">超期预警</span>
            <el-divider style="margin: 15px 0"></el-divider>
            <div style="padding: 10px;" v-if="data.warningData && data.warningData.length >0">
              <div v-for="(item,index) in data.warningData" :key="index" style="display: flex;flex-direction: column">
                <div style="display: flex">
                  <img :src="avator" style="width: 25px;height: 25px" />
                  <div style="display: flex;flex-direction: column;margin-left: 20px">
                      <span style="font-size: 16px;font-weight: 600">{{item.description}}
                      </span>
                    <span style="font-size: 14px;color: #8a8f97;margin-top: 5px">{{item.useTime}}</span>
                  </div>
                </div>
                <el-divider style="margin: 15px 0" v-if="index != data.hazmatData.length-1"></el-divider>
              </div>
            </div>
            <div v-else>
              <el-empty description="暂无数据" style="margin-top: 10%"></el-empty>
            </div>
          </el-card>
        </el-col>
      </el-row>
@@ -110,7 +96,7 @@
</template>
<script setup>
import { CountTo } from 'vue3-count-to'
import img1 from '@/assets/images/file.png'
import avator from '@/assets/images/avator.png'
import hazmat from '@/assets/logo/hazmat.png'
import warehouse from '@/assets/logo/warehouse.png'
import warning from '@/assets/logo/warning1.png'
@@ -121,6 +107,7 @@
import {ElMessage} from "element-plus";
import {getEntryData, getHazmatUseList, getHoData, getMaxUseData, getUseData} from "@/api/hazardousChemicals/count";
import {getWarning} from "@/api/hazardousChemicals/warning";
import {getRawFlow} from "@/api/hazardousChemicals/rawRecord";
const data = reactive({
  cardList: [
    {
@@ -153,6 +140,7 @@
    },
  ],
  maxUseList: [],
  maxUseName: [],
  useXData: [],
  useYData: [],
  entryXData: [],
@@ -160,7 +148,7 @@
  warningData: [],
  warningQueryParams: {
    pageNum: 1,
    pageSize: 5
    pageSize: 10
  },
  wTotal: 0,
  wloading: false,
@@ -170,7 +158,7 @@
    pageNum: 1,
    pageSize: 10
  },
  hazmatData: []
  hazmatData: [],
});
const myChart = shallowRef(null)
@@ -186,25 +174,35 @@
  await useData()
  await maxUseData()
  await getWarningData()
  await getHazmatUseData()
  await getHazmatFlowData()
});
const getWarningData = async () => {
  data.wloading = true
  const res = await getWarning(data.warningQueryParams)
  if(res.code == 200){
    data.warningData =res.data.list
    data.wTotal = res.data.total
    data.warningData =res.data.list.map(item => {
      return {
        ...item,
        description: `${item.createName} 领用了 ${item.hazmatBasic.name} 状态:${item.state ==0?'未处理':'已处理' }`
      }
    })
  }else{
    ElMessage.warning(res.message)
  }
  data.wloading = false
}
const getHazmatUseData = async () => {
const getHazmatFlowData = async () => {
  data.hloading = true
  const res = await getHazmatUseList(data.hazmatQueryParams)
  const res = await getRawFlow(data.hazmatQueryParams)
  if(res.code == 200){
    data.hazmatData =res.data.list
    data.hTotal = res.data.total
    data.hazmatData =res.data.list.map(item => {
      return {
        ...item,
        unit:item.hazmatBasic.unit,
        description: `${item.user.departName ? item.user.departName +'部门' : ''}   ${item.user.name}  进行了  ${item.state ==0?'批量导入': item.state ==1?'取用' :item.state ==2?'归还':item.state ==3?'标签作废' :''} ${item.hazmatBasic.name}`
      }
    })
    console.log('data.hazmatData',data.hazmatData)
  }else{
    ElMessage.warning(res.message)
  }
@@ -250,6 +248,7 @@
        name: item.name
      }
    })
    data.maxUseName = res.data.map(item => item.name)
    await getPieChart()
  }else{
    ElMessage.warning(res.message)
@@ -260,34 +259,39 @@
    myChart.value.dispose();
  }
  myChart.value = echarts.init(document.getElementById(pieChart.value));
  const option = {
    title: {
      text: '近一周频繁使用的危化品量',
      left: 'center'
    },
    tooltip: {
      trigger: 'item'
    },
    legend: {
      orient: 'vertical',
      left: 'left'
    },
    series: [
      {
        name: 'Access From',
        type: 'pie',
        radius: '50%',
        data: data.maxUseList,
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
  let option;
    option = {
      title: {
        text: '近一周频繁使用的危化品量',
        left: 'center'
      },
      tooltip: {
        trigger: 'item'
      },
      legend: {
        orient: 'vertical',
        left: 'left'
      },
      series: [
        {
          name: '',
          type: 'pie',
          radius: '50%',
          data: data.maxUseList,
          emphasis: {
            itemStyle: {
              shadowBlur: 10,
              shadowOffsetX: 0,
              shadowColor: 'rgba(0, 0, 0, 0.5)'
            }
          },
          // showEmptyCircle: false,
        }
      }
    ]
  };
      ]
    };
  // 使用刚指定的配置项和数据显示图表。
  myChart.value.setOption(option,true);
  //自适应宽度
@@ -422,7 +426,21 @@
    }
  }
  ::-webkit-scrollbar {
    width: 5px;
    height: 5px;
    background-color: #ffffff;
    opacity: 0;
  }
  ::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: #ffffff;
  }
  ::-webkit-scrollbar-thumb {
    border-radius: 10px;
    /*-webkit-box-shadow: inset 0 0 6px rgba(154,154,154,.3);*/
    background-color: #ffffff;
  }
}
</style>
src/views/hazardousChemicals/overdueWarning/index.vue
@@ -72,6 +72,7 @@
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import {delWarning, getWarning, handleWarning} from "@/api/hazardousChemicals/warning";
import {unWarningCount} from "@/api/hazardousChemicals/count";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
@@ -90,6 +91,7 @@
const classHourRef = ref();
onMounted(()=>{
  getList()
  getUnCount()
})
onUnmounted(()=>{
@@ -102,10 +104,20 @@
  if(res.code == 200){
    data.dataList = res.data.list
    data.total = res.data.total
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
const getUnCount = async () => {
  const res = await unWarningCount()
  if(res.code == 200){
    data.untreatedTotal = res.data
  }else{
    ElMessage.warning(res.message)
  }
}
const openDialog = (type, value) => {
@@ -120,6 +132,7 @@
    state: null
  }
  getList()
  getUnCount()
}
const handleDelete = (val) => {
  ElMessageBox.confirm(
@@ -135,6 +148,7 @@
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
          await getUnCount()
        }else{
          ElMessage.warning(res.message)
        }
@@ -151,10 +165,17 @@
        type: 'warning',
      })
      .then( async() => {
        const res = await handleWarning(val.id)
        console.log("val",val)
        const param = {
          id: val.id,
          state: 1,
          companyId: val.companyId,
        }
        const res = await handleWarning(param)
        if(res.code == 200){
          ElMessage.success('处理成功')
          await getList()
          await getUnCount()
        }else{
          ElMessage.warning(res.message)
        }
src/views/hazardousChemicals/systemManage/user/components/userDialog.vue
@@ -387,6 +387,7 @@
  superRef.value.clearValidate();
  superRef.value.resetFields()
  dialogVisible.value = false;
  emit('getList')
}
const selectValue =  (val) => {
src/views/hazardousChemicals/systemManage/user/index.vue
@@ -46,7 +46,7 @@
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
        <template #default="scope">
          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
          <el-button link type="danger" v-if="!isAdmin" @click="handleDelete(scope.row)">删除</el-button>
          <el-button link type="primary" @click="openDialog('pwd',scope.row)">修改密码</el-button>
        </template>
      </el-table-column>
@@ -109,10 +109,13 @@
});
const isAdmin = ref(false)
const { queryParams, total, dataList } = toRefs(data);
const userInfo = ref()
onMounted(()=>{
  userInfo.value = JSON.parse(Cookies.get('userInfo'))
  isAdmin.value = userInfo.value.userType === 0;
  getList()
})
src/views/hazardousChemicals/warehouseManage/components/addProDialog.vue
@@ -51,7 +51,7 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="最小包装数量:" prop="num" >
        <el-form-item label="数量:" prop="num" >
          <el-input v-model.trim="state.form.num" oninput="value=value.replace(/^\.+|[^\d]/g,'')" placeholder="请输入最小包装数量" @input="changeNum"></el-input>
        </el-form-item>
        <el-form-item label="批号:" prop="batchNo" >
@@ -97,7 +97,7 @@
  },
  formRules:{
    num: [{ required: true, trigger: "blur", message: '请输入最小包装数量' }],
    num: [{ required: true, trigger: "blur", message: '请输入数量' }],
    warehouseName: [{ required: true, trigger: "blur", message: '请选择入库仓库' }],
    basicName: [{ required: true, trigger: "blur", message: '请选择入库成品' }],
    // batchNo: [{ required: true, trigger: "blur", message: '请输入批号' }]
@@ -111,7 +111,7 @@
const openDialog = async (type, value) => {
  await getProBasic("")
  await getWareHouseList("")
  state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
  title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑':'' ;
  if(type === 'edit' ) {
    state.form = value;
@@ -165,9 +165,9 @@
  const valid = await busRef.value.validate();
  if(valid){
    if(title.value === '新增'){
      if(state.form.batchNo == ''){
        state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      }
      // if(state.form.batchNo == ''){
      //   state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      // }
      const {id, ...data} = JSON.parse(JSON.stringify(state.form))
      const res = await addProductRecord(data)
      if(res.code === 200){
@@ -183,9 +183,9 @@
      reset();
      dialogVisible.value = false;
    }else if(title.value === '编辑'){
      if(state.form.batchNo == ''){
        state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      }
      // if(state.form.batchNo == ''){
      //   state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      // }
      const {...data} = JSON.parse(JSON.stringify(state.form))
      const res = await editProductRecord(data)
      if(res.code === 200){
src/views/hazardousChemicals/warehouseManage/components/addRawDialog.vue
@@ -51,7 +51,7 @@
            />
          </el-select>
        </el-form-item>
        <el-form-item label="最小包装数量:" prop="num" >
        <el-form-item label="数量:" prop="num" >
          <el-input v-model.trim="state.form.num" oninput="value=value.replace(/^\.+|[^\d]/g,'')" placeholder="请输入最小包装数量" @input="changeNum"></el-input>
        </el-form-item>
        <el-form-item label="批号:" prop="batchNo" >
@@ -103,7 +103,7 @@
  },
  formRules:{
    num: [{ required: true, trigger: "blur", message: '请输入最小包装数量' }],
    num: [{ required: true, trigger: "blur", message: '请输入数量' }],
    warehouseName: [{ required: true, trigger: "blur", message: '请选择入库仓库' }],
    basicName: [{ required: true, trigger: "blur", message: '请选择入库成品' }],
    // batchNo: [{ required: true, trigger: "blur", message: '请输入批号' }]
@@ -117,6 +117,7 @@
const openDialog = async (type, value) => {
  await getRawBasicList("")
  await getWareHouseList("")
  state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
  title.value = type === 'add' ? '新增' : type ==='edit' ? '编辑':'' ;
  if(type === 'edit' ) {
    state.form = value;
@@ -170,9 +171,9 @@
  const valid = await busRef.value.validate();
  if(valid){
    if(title.value === '新增'){
      if(state.form.batchNo == ''){
        state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      }
      // if(state.form.batchNo == ''){
      //   state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      // }
      const {id, ...data} = JSON.parse(JSON.stringify(state.form))
      const res = await addRawRecord(data)
      if(res.code === 200){
@@ -188,9 +189,9 @@
      reset();
      dialogVisible.value = false;
    }else if(title.value === '编辑'){
      if(state.form.batchNo == ''){
        state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      }
      // if(state.form.batchNo == ''){
      //   state.form.batchNo = moment(new Date()).format("YYYY-MM-DD")
      // }
      const {...data} = JSON.parse(JSON.stringify(state.form))
      const res = await editRawRecord(data)
      if(res.code === 200){
src/views/hazardousChemicals/warehouseManage/components/printCode.vue
@@ -8,6 +8,24 @@
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <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-input v-model="state.queryParams.code" placeholder="请输入条码编号" ></el-input>
          </el-form-item>
          <el-form-item >
            <el-button
                type="primary"
                @click="getList"
            >查询</el-button>
            <el-button
                type="primary"
                plain
                @click="reset"
            >重置</el-button>
          </el-form-item>
        </el-form>
      </div>
      <el-table v-loading="state.loading" :data="state.dataList" :border="true" :show-header="false" height="550"  @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55"  align="center" />
        <el-table-column align="center" >
@@ -63,6 +81,7 @@
    pageSize: 5,
    warehouseId: null,
    basicId: null,
    code: ''
  },
  chooseList: []
@@ -103,6 +122,7 @@
    pageSize: 5,
    warehouseId: null,
    basicId: null,
    code: ''
  }
  state.total = 0
  state.chooseList = []
@@ -200,6 +220,10 @@
  :deep(.el-form .el-form-item__label) {
    font-size: 15px;
  }
  :deep(.el-dialog__body) {
    padding: 10px 20px 0 20px;
  }
  .file {
    display: flex;
    flex-direction: column;
src/views/hazardousChemicals/warehouseManage/components/proDetail.vue
对比新文件
@@ -0,0 +1,176 @@
<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-select
              v-model="data.queryParams.state"
              placeholder="请选择状态"
              style="width: 240px"
          >
            <el-option
                v-for="item in data.typeList"
                :key="item.id"
                :label="item.name"
                :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item >
          <el-button
              type="primary"
              @click="getList"
          >查询</el-button>
          <el-button
              type="primary"
              plain
              @click="reset"
          >重置</el-button>
        </el-form-item>
      </el-form>
      <div>
        <el-button
            type="primary"
            plain
            @click="back"
        >返回</el-button>
      </div>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="data.dataList" :border="true">
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="品名" prop="productBasic.name" align="center"  />
      <el-table-column label="产品编号" prop="productBasic.productSn" align="center" />
      <el-table-column label="CAS号" prop="productBasic.cas" align="center" />
      <el-table-column label="厂家" prop="productBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="productBasic.supplier" align="center" />
      <el-table-column label="二维码编号" prop="code" align="center" width="120" />
      <el-table-column label="危险性质" prop="productBasic.productCharacter" align="center" />
      <el-table-column label="最小包装" prop="productBasic.productSn" align="center" width="120">
        <template #default="scope">
          <span>{{scope.row.productBasic.metering}}{{scope.row.productBasic.unit}} / {{scope.row.productBasic.minPackage == 0 ? '瓶' :scope.row.productBasic.minPackage == 1?'袋':scope.row.productBasic.minPackage == 2?'桶 ':scope.row.productBasic.minPackage == 3?'盒':scope.row.productBasic.minPackage == 4?'箱':'其他'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="入库时间" prop="updateTime" align="center" />
      <el-table-column label="当前状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state ===0 ? '在库' : scope.row.state ===4 ? '标签作废' : scope.row.state ===5 ? '销售' : ''}}</span>
        </template>
      </el-table-column>
      <el-table-column label="在库余量" prop="remaining" align="center" >
        <template #default="scope">
          <span v-if="scope.row.state === 0">{{scope.row.remaining}}{{scope.row.productBasic.unit}}</span>
          <span v-else>—</span>
        </template>
      </el-table-column>
      <el-table-column label="所在仓库" prop="warehouseName" align="center" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" >
        <template #default="scope">
          <el-button link type="primary" @click="viewQR(scope.row)">查看二维码</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
        v-show="data.total > 0"
        :total="data.total"
        v-model:page="data.queryParams.pageNum"
        v-model:limit="data.queryParams.pageSize"
        @pagination="getList"
    />
    <viewQRcode ref="dialogRef" @getList="getList"></viewQRcode>
  </div>
</template>
<script setup>
import {nextTick, onMounted, reactive, ref} from "vue";
import {useRoute, useRouter} from "vue-router";
import {
  getWhProDetail
} from "@/api/hazardousChemicals/productRecord";
import viewQRcode from '@/views/hazardousChemicals/electronicWarehouse/components/viewQR.vue'
import {ElMessage, ElMessageBox} from "element-plus";
import Cookies from "js-cookie";
const route = useRoute()
const router = useRouter();
const dialogRef = ref();
const flowRef = ref();
const dialogVisible = ref(false)
const data = reactive({
  queryParams: {
    entryId: null,
    state: null,
    pageNum: 1,
    pageSize: 10,
  },
  total: 0,
  dataList: [],
  isAdmin: false,
  typeList: [
    {
      id: 0,
      name: '在库'
    },
    {
      id: 5,
      name: '已销售'
    },
    {
      id: 4,
      name: '标签作废'
    },
  ]
});
const loading = ref(false);
const backValue = ref({})
onMounted(async ()=>{
  if(route.query.val){
    const val = JSON.parse(route.query.val)
    backValue.value.pageNum =val.pageNum;
    backValue.value.pageSize =val.pageSize;
    data.queryParams.entryId =val.entryId
  }
  await getList()
})
const getList = async () => {
  loading.value = true
  const res = await getWhProDetail(data.queryParams)
  if(res.code == 200){
    data.dataList = res.data.list
    data.total = res.data.total
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
const reset = () => {
  data.queryParams = {
    entryId: null,
    state: null,
    pageNum: 1,
    pageSize: 10,
  }
  getList()
}
const back = () =>{
  const obj = {
    pageNum: backValue.value.pageNum,
    pageSize: backValue.value.pageSize,
  }
  const v = JSON.stringify(obj)
  Cookies.set('typeWh','pro')
  router.push({ path: "/warehouseManage", query: { val: v } });
}
const viewQR = (val) => {
  dialogRef.value.openDialog('pro',val)
}
const handleClose = () => {
  dialogVisible.value = false
}
</script>
<style scoped lang="scss">
</style>
src/views/hazardousChemicals/warehouseManage/components/productTable.vue
@@ -11,10 +11,10 @@
          >新增</el-button>
        </el-form-item>
        <el-form-item label="品名:" >
          <el-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -34,28 +34,31 @@
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="品名" prop="productBasic.name" align="center"  />
      <el-table-column label="产品编号" prop="productBasic.productSn" align="center" />
      <el-table-column label="CAS号" prop="productBasic.cas" align="center" />
      <el-table-column label="厂家" prop="productBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="productBasic.supplier" align="center" />
      <el-table-column label="危险性质" prop="productBasic.productCharacter" align="center" />
      <el-table-column label="最小包装" prop="productBasic.productSn" align="center" width="120">
        <template #default="scope">
          <span>{{scope.row.productBasic.metering}}{{scope.row.productBasic.unit}} / {{scope.row.productBasic.minPackage == 0 ? '瓶' :scope.row.productBasic.minPackage == 1?'袋':scope.row.productBasic.minPackage == 2?'桶 ':scope.row.productBasic.minPackage == 3?'盒':scope.row.productBasic.minPackage == 4?'箱':'其他'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
<!--      <el-table-column label="CAS号" prop="productBasic.cas" align="center" />-->
<!--      <el-table-column label="厂家" prop="productBasic.manufacturer" align="center" />-->
<!--      <el-table-column label="供应商" prop="productBasic.supplier" align="center" />-->
<!--      <el-table-column label="危险性质" prop="productBasic.productCharacter" align="center" />-->
<!--      <el-table-column label="最小包装" prop="productBasic.productSn" align="center" width="120">-->
<!--        <template #default="scope">-->
<!--          <span>{{scope.row.productBasic.metering}}{{scope.row.productBasic.unit}} / {{scope.row.productBasic.minPackage == 0 ? '瓶' :scope.row.productBasic.minPackage == 1?'袋':scope.row.productBasic.minPackage == 2?'桶 ':scope.row.productBasic.minPackage == 3?'盒':scope.row.productBasic.minPackage == 4?'箱':'其他'}}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="数量" prop="num" align="center" width="120" />
      <el-table-column label="所在仓库" prop="warehouseName" align="center" >
        <template #default="scope">
          <span>{{scope.row.warehouse.name}}</span>
        </template>
      </el-table-column>
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
      <el-table-column label="状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" prop="createTime" align="center" width="120" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
        <template #default="scope">
          <el-button link type="primary" v-if="scope.row.state == 1" @click="toDetail(scope.row)">查看详情</el-button>
          <el-button link type="primary" v-if="scope.row.state == 0" @click="doEntry(scope.row)">入库</el-button>
          <el-button link type="primary" v-if="scope.row.state == 1" @click="printCode(scope.row)">打印二维码</el-button>
          <el-button link type="primary" @click="openDialog('edit',scope.row)" v-if="scope.row.state == 0">编辑</el-button>
@@ -88,16 +91,21 @@
  getProWarehouseRecord
} from "@/api/hazardousChemicals/productRecord";
import {delRawRecord} from "@/api/hazardousChemicals/rawRecord";
import {useRoute, useRouter} from "vue-router";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const codeRef = ref();
const router = useRouter()
const route = useRoute()
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -130,8 +138,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
@@ -178,6 +188,16 @@
  codeRef.value.openDialog('pro',val);
}
const toDetail = (val) => {
  const obj = {
    pageNum: data.queryParams.pageNum,
    pageSize: data.queryParams.pageSize,
    entryId: val.id,
  }
  const v = JSON.stringify(obj)
  router.push({ path: "/whProDetail", query: { val: v } });
}
defineExpose({
  getList
});
src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue
对比新文件
@@ -0,0 +1,183 @@
<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-select
              v-model="data.queryParams.state"
              placeholder="请选择状态"
              style="width: 240px"
          >
            <el-option
                v-for="item in data.typeList"
                :key="item.id"
                :label="item.name"
                :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item >
          <el-button
              type="primary"
              @click="getList"
          >查询</el-button>
          <el-button
              type="primary"
              plain
              @click="reset"
          >重置</el-button>
        </el-form-item>
      </el-form>
      <div>
        <el-button
            type="primary"
            plain
            @click="back"
        >返回</el-button>
      </div>
    </div>
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="data.dataList" :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="产品编号" prop="hazmatBasic.productSn" align="center" />
      <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />
      <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />
      <el-table-column label="二维码编号" prop="code" align="center" width="120" />
      <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />
      <el-table-column label="最小包装" prop="hazmatBasic.productSn" align="center" width="120">
        <template #default="scope">
          <span>{{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{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="updateTime" align="center" />
      <el-table-column label="当前状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state ===0 || scope.row.state === 1 ? '在库' :scope.row.state === 2? '领用中': scope.row.state === 3 ? '已用完' : scope.row.state === 4 ? '标签作废' : ''}}</span>
        </template>
      </el-table-column>
      <el-table-column label="在库余量" prop="remaining" align="center" >
        <template #default="scope">
          <span v-if="scope.row.state === 0 || scope.row.state === 1">{{scope.row.remaining}}{{scope.row.hazmatBasic.unit}}</span>
          <span v-else>—</span>
        </template>
      </el-table-column>
      <el-table-column label="所在仓库" prop="warehouseName" align="center" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" >
        <template #default="scope">
          <el-button link type="primary" @click="viewQR(scope.row)">查看二维码</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
        v-show="data.total > 0"
        :total="data.total"
        v-model:page="data.queryParams.pageNum"
        v-model:limit="data.queryParams.pageSize"
        @pagination="getList"
    />
    <viewQRcode ref="dialogRef" @getList="getList"></viewQRcode>
  </div>
</template>
<script setup>
import {nextTick, onMounted, reactive, ref} from "vue";
import {useRoute, useRouter} from "vue-router";
import {ElMessage, ElMessageBox} from "element-plus";
import {disCardRaw, getRawDetail, getWhRawDetail} from "@/api/hazardousChemicals/rawRecord";
import viewQRcode from '@/views/hazardousChemicals/electronicWarehouse/components/viewQR.vue'
import Cookies from "js-cookie";
const route = useRoute()
const router = useRouter();
const dialogRef = ref();
const dialogVisible = ref(false)
const flowRef = ref();
const data = reactive({
  queryParams: {
    entryId: null,
    state: null,
    pageNum: 1,
    pageSize: 10,
  },
  total: 0,
  dataList: [],
  isAdmin: false,
  typeList: [
    {
      id: 0,
      name: '在库'
    },
    {
      id: 1,
      name: '领用归还在库'
    },
    {
      id: 2,
      name: '领用中'
    },
    {
      id: 3,
      name: '已用完'
    },
    {
      id: 4,
      name: '标签作废'
    },
  ]
});
const loading = ref(false);
const backValue = ref({})
onMounted(async ()=>{
  if(route.query.val){
    const val = JSON.parse(route.query.val)
    backValue.value.pageNum =val.pageNum;
    backValue.value.pageSize =val.pageSize;
    data.queryParams.entryId =val.entryId
  }
  await getList()
})
const getList = async () => {
  loading.value = true
  const res = await getWhRawDetail(data.queryParams)
  if(res.code == 200){
    data.dataList = res.data.list
    data.total = res.data.total
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
const reset = () => {
  data.queryParams = {
    entryId: null,
    state: null,
    pageNum: 1,
    pageSize: 10,
  }
  getList()
}
const back = () =>{
  const obj = {
    pageNum: backValue.value.pageNum,
    pageSize: backValue.value.pageSize,
    type: 'raw'
  }
  const v = JSON.stringify(obj)
  Cookies.set('typeWh','raw')
  router.push({ path: "/warehouseManage", query: { val: v } });
}
const viewQR = (val) => {
  dialogRef.value.openDialog('raw',val)
}
const handleClose = () => {
  dialogVisible.value = false
}
</script>
<style scoped lang="scss">
</style>
src/views/hazardousChemicals/warehouseManage/components/rawTable.vue
@@ -11,10 +11,10 @@
          >新增</el-button>
        </el-form-item>
        <el-form-item label="品名:" >
          <el-input v-model="data.queryParams.name" placeholder="请输入品名" clearable></el-input>
          <el-input v-model="data.queryParams.params.name" placeholder="请输入品名" clearable></el-input>
        </el-form-item>
        <el-form-item label="产品编号:" >
          <el-input v-model="data.queryParams.productSn" placeholder="请输入产品编号" clearable></el-input>
          <el-input v-model="data.queryParams.params.productSn" placeholder="请输入产品编号" clearable></el-input>
        </el-form-item>
        <el-form-item >
          <el-button
@@ -34,33 +34,36 @@
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="品名" prop="hazmatBasic.name" align="center"  />
      <el-table-column label="产品编号" prop="hazmatBasic.productSn" align="center" />
      <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />
      <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />
      <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />
      <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />
      <el-table-column label="最小包装" align="center" width="120">
        <template #default="scope">
          <span>
            {{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{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="batchNo" align="center" width="120" />
<!--      <el-table-column label="CAS号" prop="hazmatBasic.cas" align="center" />-->
<!--      <el-table-column label="厂家" prop="hazmatBasic.manufacturer" align="center" />-->
<!--      <el-table-column label="供应商" prop="hazmatBasic.supplier" align="center" />-->
<!--      <el-table-column label="危险性质" prop="hazmatBasic.hazmatCharacter" align="center" />-->
<!--      <el-table-column label="最小包装" align="center" width="120">-->
<!--        <template #default="scope">-->
<!--          <span>-->
<!--            {{scope.row.hazmatBasic.metering}}{{scope.row.hazmatBasic.unit}} / {{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="num" align="center" width="120" />
      <el-table-column label="所在仓库" prop="warehouseName" align="center" >
        <template #default="scope">
          <span>{{scope.row.warehouse.name}}</span>
        </template>
      </el-table-column>
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
      <el-table-column label="状态" prop="state" align="center">
        <template #default="scope">
          <span>{{scope.row.state === 0 ? '未入库' : '已入库'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" prop="createTime" align="center" width="120" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
        <template #default="scope">
          <el-button link type="primary" v-if="scope.row.state == 1" @click="toDetail(scope.row)">查看详情</el-button>
          <el-button link type="primary" v-if="scope.row.state == 0" @click="doEntry(scope.row)">入库</el-button>
          <el-button link type="primary" v-if="scope.row.state == 1" @click="printCode(scope.row)">打印二维码</el-button>
          <el-button link type="primary" @click="openDialog('edit',scope.row)" v-if="scope.row.state == 0">编辑</el-button>
          <el-button link type="danger" @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>
          <el-button link type="danger"  @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -84,16 +87,21 @@
import rawDialog from "./addRawDialog.vue";
import printcode from './printCode.vue'
import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord";
import {useRoute, useRouter} from "vue-router";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const codeRef = ref();
const router = useRouter()
const route = useRoute()
const data = reactive({
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  },
  total: 0,
  dataList: []
@@ -126,8 +134,10 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    name: '',
    productSn: ''
    params :{
      name: '',
      productSn: ''
    }
  }
  getList()
}
@@ -176,6 +186,17 @@
  codeRef.value.openDialog('raw',val);
}
const toDetail = (val) => {
  const obj = {
    pageNum: data.queryParams.pageNum,
    pageSize: data.queryParams.pageSize,
    entryId: val.id,
  }
  const v = JSON.stringify(obj)
  router.push({ path: "/whRawDetail", query: { val: v } });
}
defineExpose({
  getList
});
src/views/hazardousChemicals/warehouseManage/index.vue
@@ -1,20 +1,21 @@
<template>
  <div>
    <el-tabs v-model="data.activeName" class="demo-tabs" @click="clickTab" style="margin: 10px 10px">
    <el-tabs v-model="data.activeName" class="demo-tabs" @tab-click="clickTab" style="margin: 10px 10px">
      <el-tab-pane label="危化品" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
      <el-tab-pane label="成品" name="finishPro" v-if="showFinishPro">
        <pro-table ref="proRef"></pro-table>
      </el-tab-pane>
      <el-tab-pane label="原材料" name="rawMaterial">
        <raw-table ref="rawRef"></raw-table>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script setup>
import {onMounted, reactive, ref} from "vue";
import {onMounted, onUnmounted, reactive, ref} from "vue";
import proTable from './components/productTable.vue'
import rawTable from './components/rawTable.vue'
import Cookies from "js-cookie";
const showFinishPro = ref(false)
const proRef = ref()
const rawRef = ref()
@@ -25,12 +26,19 @@
  },
  total: 0,
  dataList: [],
  activeName: 'finishPro'
  activeName: 'rawMaterial'
})
onMounted(()=>{
  showFinishPro.value = true;
  data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
  if(Cookies.get('typeWh')){
    data.activeName = showFinishPro.value && Cookies.get('typeWh') ==='pro' ? 'finishPro' : 'rawMaterial'
  }else{
    // data.activeName = showFinishPro.value ? 'finishPro' : 'rawMaterial'
  }
})
onUnmounted(()=>{
  Cookies.remove('typeWh')
})
const clickTab = (tab,event) =>{
  console.log('tab',data.activeName)