zhouwx
9 days ago da1fa559f12ffc533beb6369bc6485ca303aad07
src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/index.vue
@@ -11,12 +11,12 @@
          >订单入库</el-button>
        </el-form-item>
        <el-form-item label="申购单号:" >
          <el-input v-model="data.queryParams.params.name" placeholder="请输入申购单号" clearable></el-input>
          <el-input v-model="data.queryParams.subscribeNum" placeholder="请输入申购单号" clearable></el-input>
        </el-form-item>
        <el-form-item label="主柜:" prop="warehouseName" >
          <el-select
              clearable
              v-model="data.queryParams.params.warehouseName"
              v-model="data.warehouseName"
              filterable
              remote
              reserve-keyword
@@ -37,7 +37,7 @@
        <el-form-item label="副柜:" prop="cupboardId" >
          <el-select
              clearable
              v-model="data.queryParams.params.cupboardId"
              v-model="data.queryParams.cupboardId"
              placeholder="请选择副柜"
              style="width: 100%"
          >
@@ -66,20 +66,23 @@
    <!-- 表格数据 -->
    <el-table v-loading="loading" :data="dataList" :border="true">
      <el-table-column label="序号" type="index" align="center" width="80" />
      <el-table-column label="申购单号" prop="hazmatBasicNo" align="center"  />
      <el-table-column label="危化品名称" prop="hazmatBasic.productSn" align="center" class-name="subscribe-quantity-cell">
      <el-table-column label="申购单号" prop="subscribeNum" align="center"  />
      <el-table-column label="危化品名称" align="center" class-name="subscribe-quantity-cell">
        <template #default="scope">
          <div style="width: 100%; height: 100%;display: flex; flex-direction: column;justify-content: center;align-items: center; ">
            <div
                v-for="(item, index) in scope.row.subscribeHazmats"
                v-for="(item, index) in scope.row.subscribe.subscribeHazmats"
                :key="item.id"
                style="
              width: 100%;
              text-align: center;
              padding: 8px 0;
                height: 70px;
             display: flex;
             align-items: center;
             justify-content: center;
              border-bottom: 1px solid #ebeef5;"
                :style="{
                borderBottom: index === scope.row.subscribeHazmats.length - 1 ? 'none' : '1px solid #ebeef5'
                borderBottom: index === scope.row.subscribe.subscribeHazmats.length - 1 ? 'none' : '1px solid #ebeef5'
                }"
            >
              <span>{{ item.hazmatName }}</span>
@@ -91,14 +94,17 @@
        <template #default="scope">
          <div style="width: 100%; height: 100%;display: flex; flex-direction: column;justify-content: center;align-items: center; ">
            <div
                v-for="(item, index) in scope.row.subscribeHazmats"
                v-for="(item, index) in scope.row.subscribe.subscribeHazmats"
                style="
            width: 100%;
            text-align: center;
            padding: 8px 0;
              height: 70px;
             display: flex;
             align-items: center;
             justify-content: center;
            border-bottom: 1px solid #ebeef5;"
                :style="{
              borderBottom: index === scope.row.subscribeHazmats.length - 1 ? 'none' : '1px solid #ebeef5'
              borderBottom: index === scope.row.subscribe.subscribeHazmats.length - 1 ? 'none' : '1px solid #ebeef5'
            }"
            >
              {{ item.hazmatCount }}
@@ -106,11 +112,7 @@
          </div>
        </template>
      </el-table-column>
      <el-table-column label="主柜" prop="warehouseName" align="center" >
        <template #default="scope">
          <span>{{scope.row.name}}</span>
        </template>
      </el-table-column>
      <el-table-column label="主柜" prop="warehouse.name" align="center" />
      <el-table-column label="副柜" prop="cupboard.cupboardName" align="center" width="120" />
      <el-table-column label="批号" prop="batchNo" align="center" width="120" />
      <el-table-column label="状态" prop="state" align="center">
@@ -148,6 +150,7 @@
import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord";
import {useRoute, useRouter} from "vue-router";
import {getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse";
import {delOrder, getOrderList, intoOrder} from "@/api/hazardousChemicals/orderWarehouse";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
@@ -160,13 +163,11 @@
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    params :{
      name: '',
      productSn: '',
      cupboardId: null,
      warehouseId: null
    }
    subscribeNum: '',
    cupboardId: null,
    warehouseId: null
  },
  warehouseName:'',
  total: 0,
  dataList: [],
  wareHouseList: [],
@@ -182,15 +183,15 @@
})
const getList = async () => {
  // loading.value = true
  // const res = await getRawRecord(data.queryParams)
  // if(res.code == 200){
  //   data.dataList = res.data.list
  //   data.total = res.data.total
  // }else{
  //   ElMessage.warning(res.message)
  // }
  // loading.value = false
  loading.value = true
  const res = await getOrderList(data.queryParams)
  if(res.code == 200){
    data.dataList = res.data.list.filter(i => i.subscribeNum )
    data.total = res.data.total
  }else{
    ElMessage.warning(res.message)
  }
  loading.value = false
}
const openDialog = (type, value) => {
@@ -202,14 +203,13 @@
  data.queryParams = {
    pageNum: 1,
    pageSize: 10,
    params :{
      name: '',
      productSn: '',
      cupboardId: null,
      warehouseId: null
    }
    subscribeNum: '',
    cupboardId: null,
    warehouseId: null
  }
  data.warehouseName = ''
  data.cupList = []
  getList()
  getWareHouseList("")
@@ -224,7 +224,7 @@
        type: 'warning',
      })
      .then( async() => {
        const res = await delRawRecord(val.id)
        const res = await delOrder(val.id)
        if(res.code == 200){
          ElMessage.success('数据删除成功')
          await getList()
@@ -244,7 +244,7 @@
        type: 'warning',
      })
      .then( async() => {
        const res = await doEntryRaw(val.id)
        const res = await intoOrder(val.id)
        if(res.code == 200){
          ElMessage.success('入库成功')
          await getList()
@@ -301,10 +301,10 @@
  }
}
const selectWareValue = (val) => {
  data.queryParams.params.cupboardId = null
  data.queryParams.cupboardId = null
  data.wareHouseList.forEach(item => {
    if(item.name === val){
      data.queryParams.params.warehouseId = item.id
      data.queryParams.warehouseId = item.id
      getCupList(item.id)
    }
  })