From 5612bbd431d10589a06c7ed3584de2cad1b5ea0a Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Thu, 18 Jun 2026 16:24:31 +0800
Subject: [PATCH] 中科大支线—订单入库

---
 src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/orderDialog.vue |   95 +++++++------
 src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/detail.vue      |   19 +-
 src/views/hazardousChemicals/subscribeApplyManage/subscribe/index.vue                      |   11 +
 src/views/hazardousChemicals/subscribeApplyManage/record/index.vue                         |   26 ++-
 src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/index.vue                  |   82 +++++-----
 src/api/hazardousChemicals/orderWarehouse.js                                               |   49 +++++++
 src/views/hazardousChemicals/subscribeApplyManage/subscribe/components/editDialog.vue      |   56 +++++++
 src/views/components/flowDetail.vue                                                        |    2 
 src/views/hazardousChemicals/subscribeApplyManage/approval/index.vue                       |   26 ++-
 9 files changed, 249 insertions(+), 117 deletions(-)

diff --git a/src/api/hazardousChemicals/orderWarehouse.js b/src/api/hazardousChemicals/orderWarehouse.js
new file mode 100644
index 0000000..a674cce
--- /dev/null
+++ b/src/api/hazardousChemicals/orderWarehouse.js
@@ -0,0 +1,49 @@
+import request from "@/utils/request";
+
+export function getOrderList(params) {
+    return request({
+        url: '/entry-record/orderlist',
+        method: 'get',
+        params: params
+    })
+}
+
+export function addOrder(data) {
+    return request({
+        url: '/entry-record/orderadd',
+        method: 'post',
+        data: data
+    })
+}
+
+export function editOrder(params) {
+    return request({
+        url: `/entry-record/orderedit`,
+        method: 'put',
+        data: params
+    })
+}
+
+export function delOrder(id) {
+    return request({
+        url: `/entry-record/order/` + id,
+        method: 'delete'
+    })
+}
+
+
+export function intoOrder(id) {
+    return request({
+        url: '/entry-record/orderEntry/'+ id,
+        method: 'post',
+    })
+}
+
+
+export function getOrderDetailById(data) {
+    return request({
+        url: `/entry-record/order/hazmatlist`,
+        method: 'get',
+        params:data
+    })
+}
diff --git a/src/views/components/flowDetail.vue b/src/views/components/flowDetail.vue
index a20c893..6fecfaa 100644
--- a/src/views/components/flowDetail.vue
+++ b/src/views/components/flowDetail.vue
@@ -3,7 +3,7 @@
     <div v-if="state.dataList.length>0">
       <div class="title">
         <span style="margin-right: 5px">{{state.form.name}}( {{state.form.productSn}} )</span>
-        <span>二维码识别号:{{state.form.code}} </span>
+        <span>试剂编码:{{state.form.code}} </span>
       </div>
       <div class="content" >
         <el-timeline style="max-width: 600px">
diff --git a/src/views/hazardousChemicals/subscribeApplyManage/approval/index.vue b/src/views/hazardousChemicals/subscribeApplyManage/approval/index.vue
index 954e272..33046d8 100644
--- a/src/views/hazardousChemicals/subscribeApplyManage/approval/index.vue
+++ b/src/views/hazardousChemicals/subscribeApplyManage/approval/index.vue
@@ -2,14 +2,14 @@
   <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>
-          <el-button
-              type="primary"
-              plain
-              icon="Plus"
-              @click="openDialog('add',{})"
-          >新增</el-button>
-        </el-form-item>
+<!--        <el-form-item>-->
+<!--          <el-button-->
+<!--              type="primary"-->
+<!--              plain-->
+<!--              icon="Plus"-->
+<!--              @click="openDialog('add',{})"-->
+<!--          >新增</el-button>-->
+<!--        </el-form-item>-->
         <el-form-item label="审批状态:" >
           <el-select v-model="data.queryParams.status" placeholder="请选择" >
             <el-option
@@ -67,7 +67,10 @@
                 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'
@@ -86,7 +89,10 @@
                 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'
diff --git a/src/views/hazardousChemicals/subscribeApplyManage/record/index.vue b/src/views/hazardousChemicals/subscribeApplyManage/record/index.vue
index 94f325c..4c70352 100644
--- a/src/views/hazardousChemicals/subscribeApplyManage/record/index.vue
+++ b/src/views/hazardousChemicals/subscribeApplyManage/record/index.vue
@@ -2,14 +2,14 @@
   <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>
-          <el-button
-              type="primary"
-              plain
-              icon="Plus"
-              @click="openDialog('add',{})"
-          >新增</el-button>
-        </el-form-item>
+<!--        <el-form-item>-->
+<!--          <el-button-->
+<!--              type="primary"-->
+<!--              plain-->
+<!--              icon="Plus"-->
+<!--              @click="openDialog('add',{})"-->
+<!--          >新增</el-button>-->
+<!--        </el-form-item>-->
         <el-form-item label="审批状态:" >
           <el-select v-model="data.queryParams.status" placeholder="请选择" >
             <el-option
@@ -88,7 +88,10 @@
                 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'
@@ -107,7 +110,10 @@
                 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'
diff --git a/src/views/hazardousChemicals/subscribeApplyManage/subscribe/components/editDialog.vue b/src/views/hazardousChemicals/subscribeApplyManage/subscribe/components/editDialog.vue
index 0ae5622..0c55b9f 100644
--- a/src/views/hazardousChemicals/subscribeApplyManage/subscribe/components/editDialog.vue
+++ b/src/views/hazardousChemicals/subscribeApplyManage/subscribe/components/editDialog.vue
@@ -13,10 +13,29 @@
           <div style="display: flex;width: 100%;margin-top: 5px">
             <el-table :data="state.form.subscribeHazmats" :border="true">
               <el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
-              <el-table-column label="危化品名称" align="center"  >
+              <el-table-column label="危化品名称" align="center" width="200"  >
                 <template #default="{row,$index}">
                   <el-form-item :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatName'" :rules="state.formRules.hazmatName">
-                    <el-input type="textarea" :rows="1" v-model="row.hazmatName" placeholder="请输入危化品名称"></el-input>
+                    <el-select
+                        clearable
+                        v-model="row.hazmatName"
+                        filterable
+                        remote
+                        @change="selectValueHazmat(row.hazmatName,$index)"
+                        reserve-keyword
+                        placeholder="请输入危化品名称"
+                        remote-show-suffix
+                        :remote-method="getHazmaList"
+                        style="width: 100%"
+                    >
+                      <el-option
+                          v-for="item in state.hazmatList"
+                          :key="item.id"
+                          :label="item.name"
+                          :value="item.name"
+                      />
+                    </el-select>
+<!--                    <el-input type="textarea" :rows="1" v-model="row.hazmatName" placeholder="请输入危化品名称"></el-input>-->
                   </el-form-item>
                 </template>
               </el-table-column>
@@ -95,6 +114,7 @@
 import {getToken} from "@/utils/auth";
 import {renderAsync} from "docx-preview";
 import {addSubscribe, editSubscribe} from "@/api/hazardousChemicals/subscribeApply";
+import {getBasicList} from "@/api/hazardousChemicals/basicInfo";
 
 const dialogVisible = ref(false);
 const title = ref("");
@@ -118,6 +138,7 @@
   },
 
   peopleList:[],
+  hazmatList:[],
   fileList:[],
   uploadUrl: import.meta.env.VITE_APP_BASE_API + '/system/common/uploadFile',
   header: {
@@ -129,6 +150,7 @@
 
 const openDialog = async (type, value) => {
   await getPeopleList("")
+  await getHazmaList("")
   title.value = type === 'add' ? '申购申请' : type ==='edit' ? '申购编辑' : '查看' ;
   if(type === 'edit' || type === 'view') {
     state.form = JSON.parse(JSON.stringify(value));
@@ -214,6 +236,7 @@
     }
   })
 }
+
 const getPeopleList = async (val)=>{
   let queryParams = {}
   if(val != ""){
@@ -233,6 +256,35 @@
     ElMessage.warning(res.message)
   }
 }
+const selectValueHazmat =  (val,index) => {
+  if(!val){
+    state.form.subscribeHazmats.forEach((item, i) => i === index && (item.basicId = null));
+  }
+  const match = state.hazmatList.find(item => item.name === val);
+  if (match) {
+    state.form.subscribeHazmats[index].basicId = match.id;
+    state.form.subscribeHazmats[index].hazmatName = match.name;
+  }
+}
+const getHazmaList = async (val)=>{
+  let queryParams = {}
+  if(val != ""){
+    queryParams = {
+      name: val
+    }
+  }else {
+    queryParams = {
+      pageNum: 1,
+      pageSize: 10
+    }
+  }
+  const res = await getBasicList(queryParams)
+  if(res.code == 200){
+    state.hazmatList = res.data.list
+  }else{
+    ElMessage.warning(res.message)
+  }
+}
 const handleAvatarSuccess = (res, uploadFile) => {
   if(res.code == 200){
     state.form.fileName = res.data.originName
diff --git a/src/views/hazardousChemicals/subscribeApplyManage/subscribe/index.vue b/src/views/hazardousChemicals/subscribeApplyManage/subscribe/index.vue
index 39ac05c..b317046 100644
--- a/src/views/hazardousChemicals/subscribeApplyManage/subscribe/index.vue
+++ b/src/views/hazardousChemicals/subscribeApplyManage/subscribe/index.vue
@@ -67,7 +67,10 @@
               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'
@@ -86,7 +89,11 @@
             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'
diff --git a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/detail.vue b/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/detail.vue
index b6b0fc6..fe11c73 100644
--- a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/detail.vue
+++ b/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/detail.vue
@@ -54,7 +54,7 @@
       <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 === 4 ? '标签作废' : ''}}</span>
         </template>
       </el-table-column>
       <el-table-column label="在库余量" prop="remaining" align="center" >
@@ -128,6 +128,7 @@
 } from "@/api/hazardousChemicals/rawRecord";
 import viewQRcode from '@/views/hazardousChemicals/electronicWarehouseMenu/electronicWarehouse/components/viewQR.vue'
 import Cookies from "js-cookie";
+import {getOrderDetailById} from "@/api/hazardousChemicals/orderWarehouse";
 const route = useRoute()
 const router = useRouter();
 const dialogRef = ref();
@@ -151,19 +152,19 @@
     },
     {
       id: 1,
-      name: '入库'
+      name: '回库'
     },
     {
       id: 2,
       name: '出库'
     },
-    {
-      id: 3,
-      name: '作废'
-    },
+    // {
+    //   id: 3,
+    //   name: '作废'
+    // },
     {
       id: 4,
-      name: '待入库'
+      name: '标签作废'
     },
 
   ],
@@ -188,7 +189,7 @@
 })
 const getList = async () => {
   loading.value = true
-  const res = await getWhRawDetail(data.queryParams)
+  const res = await getOrderDetailById(data.queryParams)
   if(res.code == 200){
     data.dataList = res.data.list
     data.total = res.data.total
@@ -199,7 +200,7 @@
 }
 const reset = () => {
   data.queryParams = {
-    entryId: null,
+    entryId: data.queryParams.entryId,
     state: null,
     pageNum: 1,
     pageSize: 10,
diff --git a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/orderDialog.vue b/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/orderDialog.vue
index 1f5abf4..d8a3bde 100644
--- a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/orderDialog.vue
+++ b/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/components/orderDialog.vue
@@ -9,10 +9,10 @@
         :close-on-click-modal="false"
     >
       <el-form :model="state.form" size="default" ref="busRef" :rules="state.formRules" label-width="150px" >
-        <el-form-item required label= "申购订单列表" >
+        <el-form-item  label= "申购订单列表" prop="subscribeNum">
           <el-select
               clearable
-              v-model="state.orderName"
+              v-model="state.form.subscribeNum"
               filterable
               remote
               reserve-keyword
@@ -34,15 +34,15 @@
               <el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
               <el-table-column label="危化品名称" align="center"  >
                 <template #default="{row,$index}">
-                  <el-form-item :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatName'" :rules="state.formRules.hazmatName">
-                    <el-input type="textarea" :rows="1" v-model="row.hazmatName" placeholder="请输入危化品名称"></el-input>
+                  <el-form-item align="center" :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatName'" :rules="state.formRules.hazmatName">
+                    <span>{{row.hazmatName}}</span>
                   </el-form-item>
                 </template>
               </el-table-column>
               <el-table-column label="数量" align="center"  >
                 <template #default="{row,$index}">
                   <el-form-item :prop="'subscribeHazmats.' + '[' + $index + ']' + '.hazmatCount'" :rules="state.formRules.hazmatCount">
-                    <el-input   v-model="row.hazmatCount" @input="row.hazmatCount = row.hazmatCount.replace(/[^0-9]/g,'')" placeholder="请输入数量"></el-input>
+                    <span>{{row.hazmatCount}}</span>
                   </el-form-item>
                 </template>
               </el-table-column>
@@ -110,6 +110,8 @@
 import {addSubscribe, editSubscribe, getSubscribeList} from "@/api/hazardousChemicals/subscribeApply";
 import {getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse";
 import moment from "moment";
+import Cookies from "js-cookie";
+import {addOrder, editOrder} from "@/api/hazardousChemicals/orderWarehouse";
 
 const dialogVisible = ref(false);
 const title = ref("");
@@ -119,36 +121,39 @@
 const state = reactive({
   form: {
     id: '',
-    checkId: null,
-    checkName:'',
-    subscribeHazmats:[],
+    companyId:null,
+    cupboardId: null,
+    warehouseId:null,
+    batchNo:'',
+    subscribeNum:'',
+    num:'',
+    warehouseName:'',
+    subscribeHazmats:[]
   },
+  orderName:'',
   orderList:[],
   wareHouseList: [],
   cupList: [],
+  subscribePersonId:null,
   formRules:{
-    checkId: [{ required: true, message: '请选择审核人', trigger: 'blur' }],
-    filePath:[{ required: true, message: '请上传文件', trigger: 'blur' }],
-    hazmatName: [{ required: true, message: '', trigger: 'blur' }],
-    hazmatCount: [{ required: true, message: '', trigger: 'blur' }],
+    warehouseName: [{ required: true, message: '请选择主柜', trigger: 'blur' }],
+    cupboardId:[{ required: true, message: '请选择副柜', trigger: 'blur' }],
+    subscribeNum: [{ required: true, message: '请选择申购订单', trigger: 'blur' }],
   },
 
 })
-
-
 const openDialog = async (type, value) => {
   await getOrderList("")
   await getWareHouseList("")
-  title.value = type === 'add' ? '申购申请' : type ==='edit' ? '申购编辑' : '查看' ;
+  const userInfo= JSON.parse(Cookies.get('userInfo'))
+  state.subscribePersonId = userInfo.id
+  title.value = type === 'add' ? '订单入库' : type ==='edit' ? '编辑' : '查看' ;
   if(type === 'edit' || type === 'view') {
-    state.form = JSON.parse(JSON.stringify(value));
-    if(state.form.filePath) {
-      const obj = {
-        url: value.filePath,
-        name: value.fileName
-      }
-      state.fileList = [obj]
-    }
+    Object.keys(value).forEach(key => key in state.form && (state.form[key] = value[key]));
+    state.form.subscribeHazmats = value.subscribe.subscribeHazmats
+    state.form.warehouseName = value.warehouse.name
+    state.form.companyId = userInfo.companyId
+    await getCupList(state.form.warehouseId)
   }
   state.form.batchNo = moment(new Date()).format("YYYYMMDD")
   dialogVisible.value = true;
@@ -157,9 +162,10 @@
 const onSubmit = async () => {
   const valid = await busRef.value.validate();
   if(valid){
-    if(title.value === '申购申请'){
-      const {id, ...data} = JSON.parse(JSON.stringify(state.form))
-      const res = await addSubscribe(data)
+    state.form.num = state.form.subscribeHazmats.reduce((sum, item) => sum + item.hazmatCount, 0)
+    if(title.value === '订单入库'){
+      const {id,subscribeHazmats,warehouseName,companyId, ...data} = JSON.parse(JSON.stringify(state.form))
+      const res = await addOrder(data)
       if(res.code === 200){
         ElMessage({
           type: 'success',
@@ -172,9 +178,9 @@
       busRef.value.clearValidate();
       reset();
       dialogVisible.value = false;
-    }else if(title.value === '申购编辑'){
-      const {...data} = JSON.parse(JSON.stringify(state.form))
-      const res = await editSubscribe(data)
+    }else if(title.value === '编辑'){
+      const {subscribeHazmats,warehouseName,...data} = JSON.parse(JSON.stringify(state.form))
+      const res = await editOrder(data)
       if(res.code === 200){
         ElMessage({
           type: 'success',
@@ -200,37 +206,42 @@
 const reset = () => {
   state.form = {
     id: '',
-    checkId: null,
-    filePath: '',
-    fileName: '',
+    companyId:null,
+    cupboardId: null,
+    warehouseId:null,
+    batchNo:'',
+    subscribeNum:'',
+    num:'',
     subscribeHazmats:[],
+    warehouseName:''
   }
+  state.subscribePersonId = null
+  state.orderName = ''
 }
 const selectValue = (val) => {
-  state.form.orderId = null
   if(!val){
     state.form.subscribeHazmats = []
     return
   }
-  state.orderList.forEach(item => {
-    if(item.subscribeNum === val){
-      state.form.orderId = item.id
-      state.form.subscribeHazmats = item.subscribeHazmats
-    }
-  })
+  const match  = state.orderList.find(i => i.subscribeNum == val)
+  if(match){
+    state.form.subscribeHazmats = match.subscribeHazmats
+  }
 }
 const getOrderList = async (val) => {
   let param = {}
   if(val != ""){
     param = {
-      name: val,
-      status: 1
+      subscribeNum: val,
+      status: 1,
+      subscribePersonId:state.subscribePersonId
     }
   }else {
     param = {
       pageNum: 1,
       pageSize: 10,
-      status: 1
+      status: 1,
+      subscribePersonId:state.subscribePersonId
     }
   }
   const res = await getSubscribeList(param)
diff --git a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/index.vue b/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/index.vue
index 1f139ab..1b68a46 100644
--- a/src/views/hazardousChemicals/warehouseManageMenu/orderWarehouse/index.vue
+++ b/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)
     }
   })

--
Gitblit v1.9.2