|
|
@@ -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({
|