|
@ -1,405 +1,138 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<el-form |
|
|
<Search :schema="Supplieritem.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
class="-mb-15px" |
|
|
|
|
|
:model="queryParams" |
|
|
|
|
|
ref="queryFormRef" |
|
|
|
|
|
:inline="true" |
|
|
|
|
|
label-width="68px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-form-item label="供应商代码" prop="supplierCode"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.supplierCode" |
|
|
|
|
|
placeholder="请输入供应商代码" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="物料代码" prop="itemCode"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.itemCode" |
|
|
|
|
|
placeholder="请输入物料代码" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商物料代码" prop="supplierItemCode"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.supplierItemCode" |
|
|
|
|
|
placeholder="请输入供应商物料代码" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商计量单位" prop="supplierUom"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="queryParams.supplierUom" |
|
|
|
|
|
placeholder="请选择供应商计量单位" |
|
|
|
|
|
clearable |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.UOM)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="转换率" prop="convertRate"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.convertRate" |
|
|
|
|
|
placeholder="请输入转换率" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商包装单位" prop="packUnit"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="queryParams.packUnit" |
|
|
|
|
|
placeholder="请选择供应商包装单位" |
|
|
|
|
|
clearable |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商包装量" prop="packQty"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.packQty" |
|
|
|
|
|
placeholder="请输入供应商包装量" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商替代包装单位" prop="altPackUnit"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="queryParams.altPackUnit" |
|
|
|
|
|
placeholder="请选择供应商替代包装单位" |
|
|
|
|
|
clearable |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.PACK_UNIT)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="供应商替代包装量" prop="altPackQty"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.altPackQty" |
|
|
|
|
|
placeholder="请输入供应商替代包装量" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="每器具包装数" prop="packQtyOfContainer"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.packQtyOfContainer" |
|
|
|
|
|
placeholder="请输入每器具包装数" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="默认收货仓库" prop="defaultWarehouseCode"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.defaultWarehouseCode" |
|
|
|
|
|
placeholder="请输入默认收货仓库" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="默认收货库位" prop="defaultLocationCode"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.defaultLocationCode" |
|
|
|
|
|
placeholder="请输入默认收货库位" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="结算方式" prop="settlementType"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="queryParams.settlementType" |
|
|
|
|
|
placeholder="请选择结算方式" |
|
|
|
|
|
clearable |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.SETTLEMENT_TYPE)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="是否可用" prop="available"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="queryParams.available" |
|
|
|
|
|
placeholder="请选择是否可用" |
|
|
|
|
|
clearable |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in getIntDictOptions(DICT_TYPE.TRUE_FALSE)" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="生效时间" prop="activeTime"> |
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
v-model="queryParams.activeTime" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
|
type="daterange" |
|
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="失效时间" prop="expireTime"> |
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
v-model="queryParams.expireTime" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
|
type="daterange" |
|
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.remark" |
|
|
|
|
|
placeholder="请输入备注" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="创建时间" prop="createTime"> |
|
|
|
|
|
<el-date-picker |
|
|
|
|
|
v-model="queryParams.createTime" |
|
|
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
|
|
type="daterange" |
|
|
|
|
|
start-placeholder="开始日期" |
|
|
|
|
|
end-placeholder="结束日期" |
|
|
|
|
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="创建者ID" prop="creator"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="queryParams.creator" |
|
|
|
|
|
placeholder="请输入创建者ID" |
|
|
|
|
|
clearable |
|
|
|
|
|
@keyup.enter="handleQuery" |
|
|
|
|
|
class="!w-240px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="info" plain @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
|
|
|
|
|
<el-button type="info" plain @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
@click="openForm('create')" |
|
|
|
|
|
v-hasPermi="['wms:supplieritem:create']" |
|
|
|
|
|
> |
|
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="success" |
|
|
|
|
|
@click="handleExport" |
|
|
|
|
|
:loading="exportLoading" |
|
|
|
|
|
v-hasPermi="['wms:supplieritem:export']" |
|
|
|
|
|
> |
|
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
|
|
<TableHead :HeadButttondata="HeadButttondata" @button-base-click="buttonBaseClick" /> |
|
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
<!-- 列表 --> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> |
|
|
<Table |
|
|
<el-table-column label="供应商代码" align="center" prop="supplierCode" width="150px" /> |
|
|
:columns="Supplieritem.allSchemas.tableColumns" |
|
|
<el-table-column label="物料代码" align="center" prop="itemCode" width="150px" /> |
|
|
:data="tableObject.tableList" |
|
|
<el-table-column label="供应商物料代码" align="center" prop="supplierItemCode" width="150px" /> |
|
|
:loading="tableObject.loading" |
|
|
<el-table-column label="供应商计量单位" align="center" prop="supplierUom" width="150px"> |
|
|
:pagination="{ |
|
|
<template #default="scope"> |
|
|
total: tableObject.total |
|
|
<dict-tag :type="DICT_TYPE.UOM" :value="scope.row.supplierUom" /> |
|
|
}" |
|
|
</template> |
|
|
v-model:pageSize="tableObject.pageSize" |
|
|
</el-table-column> |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
<el-table-column label="转换率" align="center" prop="convertRate" width="150px" /> |
|
|
v-model:sort="tableObject.sort" |
|
|
<el-table-column label="供应商包装单位" align="center" prop="packUnit" width="150px"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.packUnit" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="供应商包装量" align="center" prop="packQty" width="150px" /> |
|
|
|
|
|
<el-table-column label="供应商替代包装单位" align="center" prop="altPackUnit" width="150px"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :type="DICT_TYPE.PACK_UNIT" :value="scope.row.altPackUnit" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="供应商替代包装量" align="center" prop="altPackQty" width="150px" /> |
|
|
|
|
|
<el-table-column label="每器具包装数" align="center" prop="packQtyOfContainer" width="150px" /> |
|
|
|
|
|
<el-table-column label="默认收货仓库" align="center" prop="defaultWarehouseCode" width="150px" /> |
|
|
|
|
|
<el-table-column label="默认收货库位" align="center" prop="defaultLocationCode" width="150px" /> |
|
|
|
|
|
<el-table-column label="结算方式" align="center" prop="settlementType" width="150px"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :type="DICT_TYPE.SETTLEMENT_TYPE" :value="scope.row.settlementType" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column label="是否可用" align="center" prop="available" width="150px"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<dict-tag :type="DICT_TYPE.TRUE_FALSE" :value="scope.row.available" /> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
label="生效时间" |
|
|
|
|
|
align="center" |
|
|
|
|
|
prop="activeTime" |
|
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
|
width="150px" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
label="失效时间" |
|
|
|
|
|
align="center" |
|
|
|
|
|
prop="expireTime" |
|
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
|
width="150px" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" width="150px" /> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
align="center" |
|
|
|
|
|
prop="createTime" |
|
|
|
|
|
:formatter="dateFormatter" |
|
|
|
|
|
width="150px" |
|
|
|
|
|
/> |
|
|
|
|
|
<el-table-column label="创建者ID" align="center" prop="creator" width="150px" /> |
|
|
|
|
|
<el-table-column label="操作" align="center" width="150px" fixed="right"> |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
link |
|
|
|
|
|
type="primary" |
|
|
|
|
|
@click="openForm('update', scope.row.id)" |
|
|
|
|
|
v-hasPermi="['wms:supplieritem:update']" |
|
|
|
|
|
> |
|
|
|
|
|
编辑 |
|
|
|
|
|
</el-button> |
|
|
|
|
|
<el-button |
|
|
|
|
|
link |
|
|
|
|
|
type="danger" |
|
|
|
|
|
@click="handleDelete(scope.row.id)" |
|
|
|
|
|
v-hasPermi="['wms:supplieritem:delete']" |
|
|
|
|
|
> |
|
|
> |
|
|
删除 |
|
|
<template #supplierCode="{row}"> |
|
|
|
|
|
<el-button type="primary" link @click="openDetail(row, '供应商代码', row.supplierCode)"> |
|
|
|
|
|
<span>{{ row.supplierCode }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
<template #action="{ row }"> |
|
|
</el-table> |
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
<!-- 分页 --> |
|
|
</template> |
|
|
<Pagination |
|
|
</Table> |
|
|
:total="total" |
|
|
|
|
|
v-model:page="queryParams.pageNo" |
|
|
|
|
|
v-model:limit="queryParams.pageSize" |
|
|
|
|
|
@pagination="getList" |
|
|
|
|
|
/> |
|
|
|
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<SupplieritemForm ref="formRef" @success="getList" /> |
|
|
<BasicForm |
|
|
|
|
|
ref="basicFormRef" |
|
|
|
|
|
@success="getList" |
|
|
|
|
|
:rules="SupplieritemRules" |
|
|
|
|
|
:formAllSchemas="Supplieritem.allSchemas" |
|
|
|
|
|
searchTableTitle="物料基础信息" |
|
|
|
|
|
:searchTableAllSchemas="ItemBasic.allSchemas" |
|
|
|
|
|
:searchTablePage="ItembasicApi.getItembasicPage" |
|
|
|
|
|
:apiUpdate="SupplieritemApi.updateSupplieritem" |
|
|
|
|
|
:apiCreate="SupplieritemApi.createSupplieritem" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="Supplieritem.allSchemas" /> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
|
|
<ImportForm ref="importFormRef" url="/wms/Supplieritem/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { DICT_TYPE, getStrDictOptions, getIntDictOptions } from '@/utils/dict' |
|
|
|
|
|
import { dateFormatter } from '@/utils/formatTime' |
|
|
|
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
import SupplieritemForm from './SupplieritemForm.vue' |
|
|
import * as ItembasicApi from '@/api/wms/itembasic' |
|
|
|
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
|
|
|
import { Supplieritem, SupplieritemRules, ItemBasic } from '@/utils/disposition/tableColumns' |
|
|
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'Supplieritem' }) |
|
|
defineOptions({ name: 'Supplieritem' }) |
|
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中 |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const total = ref(0) // 列表的总页数 |
|
|
getListApi: SupplieritemApi.getSupplieritemPage // 分页接口 |
|
|
const list = ref([]) // 列表的数据 |
|
|
|
|
|
const queryParams = reactive({ |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
supplierCode: null, |
|
|
|
|
|
itemCode: null, |
|
|
|
|
|
supplierItemCode: null, |
|
|
|
|
|
supplierUom: null, |
|
|
|
|
|
convertRate: null, |
|
|
|
|
|
packUnit: null, |
|
|
|
|
|
packQty: null, |
|
|
|
|
|
altPackUnit: null, |
|
|
|
|
|
altPackQty: null, |
|
|
|
|
|
packQtyOfContainer: null, |
|
|
|
|
|
defaultWarehouseCode: null, |
|
|
|
|
|
defaultLocationCode: null, |
|
|
|
|
|
settlementType: null, |
|
|
|
|
|
available: null, |
|
|
|
|
|
activeTime: [], |
|
|
|
|
|
expireTime: [], |
|
|
|
|
|
remark: null, |
|
|
|
|
|
createTime: [], |
|
|
|
|
|
creator: null |
|
|
|
|
|
}) |
|
|
}) |
|
|
const queryFormRef = ref() // 搜索的表单 |
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */ |
|
|
// 获得表格的各种操作 |
|
|
const getList = async () => { |
|
|
const { getList, setSearchParams } = tableMethods |
|
|
loading.value = true |
|
|
|
|
|
try { |
|
|
// 列表头部按钮 |
|
|
const data = await SupplieritemApi.getSupplieritemPage(queryParams) |
|
|
const HeadButttondata = [ |
|
|
list.value = data.list |
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:supplieritem:create'}), // 新增 |
|
|
total.value = data.total |
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:supplieritem:import'}), // 导入 |
|
|
} finally { |
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:supplieritem:export'}), // 导出 |
|
|
loading.value = false |
|
|
// defaultButtons.defaultFilterBtn(), // 筛选 |
|
|
} |
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
} |
|
|
// { |
|
|
|
|
|
// label: '自定义扩展按钮', |
|
|
|
|
|
// name: 'zdy', |
|
|
|
|
|
// hide: false, |
|
|
|
|
|
// type: 'primary', |
|
|
|
|
|
// icon: 'Select', |
|
|
|
|
|
// color: '' |
|
|
|
|
|
// }, |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */ |
|
|
// 头部按钮事件 |
|
|
const handleQuery = () => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
queryParams.pageNo = 1 |
|
|
if (val == 'add') { // 新增 |
|
|
|
|
|
openForm('create') |
|
|
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
|
|
handleImport() |
|
|
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
|
|
handleExport() |
|
|
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
getList() |
|
|
getList() |
|
|
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
|
|
} else { // 其他按钮 |
|
|
|
|
|
console.log('其他按钮', item) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 重置按钮操作 */ |
|
|
// 列表-操作按钮 |
|
|
const resetQuery = () => { |
|
|
const butttondata = [ |
|
|
queryFormRef.value.resetFields() |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:supplieritem:update'}), // 编辑 |
|
|
handleQuery() |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:supplieritem:delete'}), // 删除 |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
|
|
// const res = await SupplieritemApi.getItempackaging(row.id) |
|
|
|
|
|
openForm('update', row) |
|
|
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
|
|
handleDelete(row.id) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const formRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, id?: number) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
formRef.value.open(type, id) |
|
|
basicFormRef.value.open(type, row) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
|
|
|
const detailRef = ref() |
|
|
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
|
|
detailRef.value.openDetail(row, titleName, titleValue) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
/** 删除按钮操作 */ |
|
@ -416,13 +149,14 @@ const handleDelete = async (id: number) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const handleExport = async () => { |
|
|
const handleExport = async () => { |
|
|
try { |
|
|
try { |
|
|
// 导出的二次确认 |
|
|
// 导出的二次确认 |
|
|
await message.exportConfirm() |
|
|
await message.exportConfirm() |
|
|
// 发起导出 |
|
|
// 发起导出 |
|
|
exportLoading.value = true |
|
|
exportLoading.value = true |
|
|
const data = await SupplieritemApi.exportSupplieritem(queryParams) |
|
|
const data = await SupplieritemApi.exportSupplieritem(setSearchParams) |
|
|
download.excel(data, '供应商物品.xls') |
|
|
download.excel(data, '供应商物品.xls') |
|
|
} catch { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
@ -430,6 +164,21 @@ const handleExport = async () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
|
|
const importFormRef = ref() |
|
|
|
|
|
const handleImport = () => { |
|
|
|
|
|
importFormRef.value.open() |
|
|
|
|
|
} |
|
|
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
|
|
const importTemplateData = reactive({ |
|
|
|
|
|
templateUrl: '', |
|
|
|
|
|
templateTitle: '供应商物品导入模版.xls' |
|
|
|
|
|
}) |
|
|
|
|
|
// 导入成功之后 |
|
|
|
|
|
const importSuccess = () => { |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
getList() |
|
|
getList() |
|
|