|
@@ -58,6 +58,7 @@
|
|
|
<el-button v-hasPermi="['warehouses:materialsIn:export']" link type="success" @click="handleExport(row.id)" :loading="exportLoading">导出</el-button>
|
|
<el-button v-hasPermi="['warehouses:materialsIn:export']" link type="success" @click="handleExport(row.id)" :loading="exportLoading">导出</el-button>
|
|
|
<el-button v-hasPermi="['warehouses:materialsIn:print']" link type="primary" @click="handlePrint(row)">打印</el-button>
|
|
<el-button v-hasPermi="['warehouses:materialsIn:print']" link type="primary" @click="handlePrint(row)">打印</el-button>
|
|
|
<el-button v-hasPermi="['warehouses:materialsIn:delete']" link type="danger" @click="handleDelete(row)">删除</el-button>
|
|
<el-button v-hasPermi="['warehouses:materialsIn:delete']" link type="danger" @click="handleDelete(row)">删除</el-button>
|
|
|
|
|
+ <el-button v-hasPermi="['warehouses:materialsIn:generateOutbound']" link type="primary" @click="handleGenerateOutbound(row)">生成出库单</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -83,6 +84,13 @@
|
|
|
:warehouse-options="warehouseOptions"
|
|
:warehouse-options="warehouseOptions"
|
|
|
@refresh="getTableData"
|
|
@refresh="getTableData"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <GenerateOutboundDialog
|
|
|
|
|
+ v-model="generateOutboundVisible"
|
|
|
|
|
+ :inbound-order-id="generateInboundOrderId"
|
|
|
|
|
+ :tenant-id="generateTenantId"
|
|
|
|
|
+ :department-options="departmentOptions"
|
|
|
|
|
+ @success="getTableData"
|
|
|
|
|
+ />
|
|
|
<Print ref="printRef" />
|
|
<Print ref="printRef" />
|
|
|
<!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
|
|
<!-- 导入弹窗(复用 system/user 的 ImportFile 组件) -->
|
|
|
<Import ref="importRef" :config="importConfig" @success="handleImportSuccess" />
|
|
<Import ref="importRef" :config="importConfig" @success="handleImportSuccess" />
|
|
@@ -99,10 +107,13 @@ import { materialList } from '@/api/material/basicMessage'
|
|
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
|
import Import from '@/components/ImportFile/index.vue'
|
|
import Import from '@/components/ImportFile/index.vue'
|
|
|
|
|
+import { handleTree } from '@/utils/tree'
|
|
|
|
|
+import * as DeptApi from '@/api/system/dept'
|
|
|
|
|
|
|
|
const message = useMessage()
|
|
const message = useMessage()
|
|
|
|
|
|
|
|
const MaterialsInDialog = defineAsyncComponent(() => import('./components/MaterialsInDialog.vue'))
|
|
const MaterialsInDialog = defineAsyncComponent(() => import('./components/MaterialsInDialog.vue'))
|
|
|
|
|
+const GenerateOutboundDialog = defineAsyncComponent(() => import('./components/GenerateOutboundDialog.vue'))
|
|
|
const Print = defineAsyncComponent(() => import('./components/Print.vue'))
|
|
const Print = defineAsyncComponent(() => import('./components/Print.vue'))
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
@@ -123,6 +134,9 @@ const exportLoading = ref(false)
|
|
|
// 弹窗
|
|
// 弹窗
|
|
|
const dialogVisible = ref(false)
|
|
const dialogVisible = ref(false)
|
|
|
const dialogMode = ref('add') // 'add', 'edit', 'view'
|
|
const dialogMode = ref('add') // 'add', 'edit', 'view'
|
|
|
|
|
+const generateOutboundVisible = ref(false)
|
|
|
|
|
+const generateInboundOrderId = ref(undefined)
|
|
|
|
|
+const generateTenantId = ref(undefined)
|
|
|
|
|
|
|
|
const initialForm = {
|
|
const initialForm = {
|
|
|
id: null,
|
|
id: null,
|
|
@@ -141,13 +155,14 @@ const initialForm = {
|
|
|
|
|
|
|
|
const form = reactive({ ...initialForm })
|
|
const form = reactive({ ...initialForm })
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 模拟的物资选项 (用于 el-select-v2)
|
|
// 模拟的物资选项 (用于 el-select-v2)
|
|
|
const materialOptions = ref([])
|
|
const materialOptions = ref([])
|
|
|
|
|
|
|
|
// 模拟的仓库选项
|
|
// 模拟的仓库选项
|
|
|
const warehouseOptions = ref([])
|
|
const warehouseOptions = ref([])
|
|
|
|
|
|
|
|
|
|
+// 部门下拉
|
|
|
|
|
+const departmentOptions = ref([])
|
|
|
|
|
|
|
|
// 导入(复用 ImportFile 组件)
|
|
// 导入(复用 ImportFile 组件)
|
|
|
const importRef = ref()
|
|
const importRef = ref()
|
|
@@ -222,6 +237,10 @@ const fetchStoreOptions = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const fetchDepartmentOptions = async () => {
|
|
|
|
|
+ departmentOptions.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 获取表格数据(分页接口)
|
|
// 获取表格数据(分页接口)
|
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
@@ -387,6 +406,18 @@ const handleDelete = (row) => {
|
|
|
})
|
|
})
|
|
|
.catch(() => {})
|
|
.catch(() => {})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 生成出库单
|
|
|
|
|
+const handleGenerateOutbound = async (row) => {
|
|
|
|
|
+ if(queryParams.tenantIds.length == 0 || queryParams.tenantIds.length > 1){
|
|
|
|
|
+ ElMessage.error('生成出库单只能选择一个机构')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ await fetchDepartmentOptions()
|
|
|
|
|
+ generateInboundOrderId.value = row.id
|
|
|
|
|
+ generateTenantId.value = row.tenantId || (queryParams.tenantIds ? queryParams.tenantIds[0] : undefined)
|
|
|
|
|
+ generateOutboundVisible.value = true
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|