前端:增加批次管理与旧数据纳入
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8 master-toolbar">
|
||||
<el-row v-if="isMasterWriteAllowed" :gutter="10" class="mb8 master-toolbar">
|
||||
<el-col :span="1.5"><el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['master:warehouse:add']">新增</el-button></el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -30,6 +30,9 @@
|
||||
<el-col :span="1.5"><el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['master:warehouse:remove']">删除</el-button></el-col>
|
||||
<el-col :span="1.5"><el-button type="warning" plain icon="User" :disabled="single" @click="handleAssign()" v-hasPermi="['master:warehouse:assign']">分配用户</el-button></el-col>
|
||||
</el-row>
|
||||
<el-row v-if="userStore.admin === true && !testBatchStore.isTestMode" :gutter="10" class="mb8 master-toolbar">
|
||||
<el-col :span="1.5"><el-button type="warning" plain icon="FolderAdd" :disabled="!selectedIds.length" @click="openAdoptionDialog">纳入测试批次</el-button></el-col>
|
||||
</el-row>
|
||||
|
||||
<el-alert v-if="loadError" :title="loadError" type="error" :closable="false" show-icon class="mb8" />
|
||||
<el-table class="master-table data-table" v-loading="loading" empty-text="暂无数据" :data="warehouseList" @selection-change="handleSelectionChange">
|
||||
@@ -44,7 +47,7 @@
|
||||
<el-table-column label="创建时间" prop="createTime" align="center" width="180">
|
||||
<template #default="scope"><span>{{ parseTime(scope.row.createTime) }}</span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="260" class-name="small-padding fixed-width">
|
||||
<el-table-column v-if="isMasterWriteAllowed" label="操作" align="center" width="260" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="User" @click="handleAssign(scope.row)" v-hasPermi="['master:warehouse:assign']">分配</el-button>
|
||||
<el-button
|
||||
@@ -63,6 +66,7 @@
|
||||
v-show="total > 0" :total="total"
|
||||
v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList"
|
||||
/>
|
||||
<test-batch-adoption-dialog ref="adoptionDialogRef" :root-type="'warehouse'" :resource-ids="selectedIds" @success="getList" />
|
||||
|
||||
<el-dialog
|
||||
v-model="open"
|
||||
@@ -118,8 +122,15 @@
|
||||
<script setup name="Warehouse">
|
||||
import BusinessUserAssignDialog from "@/components/BusinessUserAssignDialog";
|
||||
import { addWarehouse, delWarehouse, getWarehouse, listWarehouse, updateWarehouse } from "@/api/master/warehouse";
|
||||
import TestBatchAdoptionDialog from '@/components/TestBatchAdoptionDialog'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useTestBatchStore from '@/store/modules/testBatch'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore()
|
||||
const testBatchStore = useTestBatchStore()
|
||||
const isMasterWriteAllowed = computed(() => userStore.admin === true || !testBatchStore.isTestMode)
|
||||
const adoptionDialogRef = ref()
|
||||
const { sys_normal_disable } = proxy.useDict("sys_normal_disable");
|
||||
const warehouseList = ref([]);
|
||||
const selectedIds = ref([]);
|
||||
@@ -224,6 +235,8 @@ function handleSelectionChange(selection) {
|
||||
single.value = selectedIds.value.length !== 1;
|
||||
multiple.value = removableIds.value.length === 0;
|
||||
}
|
||||
|
||||
function openAdoptionDialog() { adoptionDialogRef.value?.open() }
|
||||
function handleAdd() {
|
||||
invalidateDetailRequest();
|
||||
reset();
|
||||
|
||||
Reference in New Issue
Block a user