Jelajahi Sumber

Merge branch 'xiongxingbranch'

xiongxing 2 bulan lalu
induk
melakukan
05f59e1882

+ 1 - 1
src/views/Home/Index.vue

@@ -4,7 +4,7 @@
       <el-segmented v-model="valueTop" :options="optionsTop" size="large" />
       <el-scrollbar v-if="valueTop=='我的常用'">
         <div class="icon-wrap">
-          <div class="icon-item" @click="handleGridDataStatistics">
+          <div class="icon-item" @click="handleGridDataStatistics" v-hasPermi="['home:gridDataStatistics']">
             <Icon :icon="'ep:copy-document'" :size="56" />
             <div class="text">院区数据统计</div>
           </div>

+ 28 - 0
src/views/warehouses/materialsIn/index.vue

@@ -39,6 +39,7 @@
     <el-card shadow="never" class="mt-4">
       <div class="mb-4">
         <el-button v-hasPermi="['warehouses:materialsIn:add']" type="primary" plain @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
+        <el-button v-hasPermi="['warehouses:materialsIn:import']" type="success" @click="openImport"><Icon icon="ep:download" class="mr-5px" />导入</el-button>
       </div>
 
       <el-table :data="tableData" v-loading="loading" :header-cell-style="tableHeaderColor">
@@ -83,6 +84,8 @@
       @refresh="getTableData"
     />
     <Print ref="printRef" />
+    <!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
+    <Import ref="importRef" :config="importConfig" @success="handleImportSuccess" />
   </div>
 </template>
 
@@ -95,6 +98,7 @@ import { materialIoPage,getMaterialIoInboundDetail,materialIoDelete, exportMater
 import { materialList } from '@/api/material/basicMessage'
 import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
 import download from '@/utils/download'
+import Import from '@/components/ImportFile/index.vue'
 
 const message = useMessage()
 
@@ -144,6 +148,30 @@ const materialOptions = ref([])
 // 模拟的仓库选项
 const warehouseOptions = ref([])
 
+
+// 导入(复用 ImportFile 组件)
+const importRef = ref()
+const importConfig = reactive({
+  title: '物资入库导入',
+  // TODO: 替换成你的真实导入接口
+  importUrl: '/material-io/inbound/import',
+  excelTempName: '物资入库导入模板',
+  // TODO: 替换成你的真实模板下载接口
+  downloadUrl: '/material-io/inbound/import-template',
+  desc: '物资入库',
+  // TODO: 如果后端支持失败信息导出,填真实接口;不支持可留空
+  failExportUrl: '',
+})
+
+const openImport = () => {
+  importRef.value?.open?.()
+}
+
+const handleImportSuccess = () => {
+  // 导入成功后刷新列表
+  getTableData()
+}
+
 const getMaterialOptions = async () => {
   try {
     const res = await materialList({ 

+ 28 - 0
src/views/warehouses/materialsOut/index.vue

@@ -39,6 +39,7 @@
     <el-card shadow="never" class="mt-4">
       <div class="mb-4">
         <el-button v-hasPermi="['warehouses:materialsOut:add']" type="primary" plain @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" />新增</el-button>
+        <el-button v-hasPermi="['warehouses:materialsOut:import']" type="success" @click="openImport"><Icon icon="ep:download" class="mr-5px" />导入</el-button>
       </div>
 
       <el-table :data="tableData" v-loading="loading" :header-cell-style="tableHeaderColor">
@@ -84,6 +85,8 @@
       @refresh="getTableData"
     />
     <Print ref="printRef" />
+    <!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
+    <Import ref="importRef" :config="importConfig" @success="handleImportSuccess" />
   </div>
 </template>
 
@@ -96,6 +99,8 @@ import { handleTree } from '@/utils/tree'
 import * as DeptApi from '@/api/system/dept'
 import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
 import download from '@/utils/download'
+import Import from '@/components/ImportFile/index.vue'
+
 
 const MaterialsOutDialog = defineAsyncComponent(() => import('./components/MaterialsOutDialog.vue'))
 const Print = defineAsyncComponent(() => import('./components/Print.vue'))
@@ -149,6 +154,29 @@ const initialForm = {
 
 const form = reactive({ ...initialForm })
 
+// 导入(复用 ImportFile 组件)
+const importRef = ref()
+const importConfig = reactive({
+  title: '物资出库导入',
+  // TODO: 替换成你的真实导入接口
+  importUrl: '/material-io/outbound/import',
+  excelTempName: '物资出库导入模板',
+  // TODO: 替换成你的真实模板下载接口
+  downloadUrl: '/material-io/outbound/import-template',
+  desc: '物资出库',
+  // TODO: 如果后端支持失败信息导出,填真实接口;不支持可留空
+  failExportUrl: '',
+})
+
+const openImport = () => {
+  importRef.value?.open?.()
+}
+
+const handleImportSuccess = () => {
+  // 导入成功后刷新列表
+  getTableData()
+}
+
 const getMaterialIoInboundBatchList = async()=>{
   try {
     const res = await materialIoInboundBatchList({