|
|
@ -1,18 +1,22 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="Configurationsetting.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search |
|
|
|
:schema="Configurationsetting.allSchemas.searchSchema" |
|
|
|
@search="setSearchParams" |
|
|
|
@reset="setSearchParams" |
|
|
|
/> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
|
<TableHead |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:route-name="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="Configurationsetting.allSchemas" |
|
|
|
/> |
|
|
|
:HeadButttondata="HeadButttondata" |
|
|
|
@button-base-click="buttonBaseClick" |
|
|
|
:route-name="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="Configurationsetting.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
|
<ContentWrap> |
|
|
@ -27,23 +31,23 @@ |
|
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
|
v-model:sort="tableObject.sort" |
|
|
|
> |
|
|
|
<template #strategyType="{row}"> |
|
|
|
<template #strategyType="{ row }"> |
|
|
|
<el-button type="primary" link @click="openDetail(row, '策略类型', row.strategyType)"> |
|
|
|
<span>{{ formatter(row.strategyType) }}</span> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="getList" |
|
|
|
:rules="ConfigurationsettingRules" |
|
|
|
:formAllSchemas="Configurationsetting.allSchemas" |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="ConfigurationsettingRules" |
|
|
|
:formAllSchemas="Configurationsetting.allSchemas" |
|
|
|
:apiUpdate="ConfigurationsettingApi.updateConfigurationsetting" |
|
|
|
:apiCreate="ConfigurationsettingApi.createConfigurationsetting" |
|
|
|
:isBusiness="false" |
|
|
@ -53,7 +57,12 @@ |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="Configurationsetting.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/configurationsetting/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
<ImportForm |
|
|
|
ref="importFormRef" |
|
|
|
url="/wms/configurationsetting/import" |
|
|
|
:importTemplateData="importTemplateData" |
|
|
|
@success="importSuccess" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
@ -62,7 +71,7 @@ import * as ConfigurationsettingApi from '@/api/wms/configurationsetting' |
|
|
|
import BasicForm from '@/components/BasicForm/src/BasicForm.vue' |
|
|
|
import { Configurationsetting, ConfigurationsettingRules } from './configurationsetting.data' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
|
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
|
import Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
@ -91,12 +100,12 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:configurationsetting:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:configurationsetting:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:configurationsetting:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null),//刷新 |
|
|
|
defaultButtons.defaultAddBtn({ hasPermi: 'wms:configurationsetting:create' }), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({ hasPermi: 'wms:configurationsetting:import' }), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({ hasPermi: 'wms:configurationsetting:export' }), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), //刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), //筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
defaultButtons.defaultSetBtn(null) // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
@ -107,34 +116,42 @@ const HeadButttondata = [ |
|
|
|
// }, |
|
|
|
] |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
|
// 头部按钮事件 |
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
if (val == 'add') { // 新增 |
|
|
|
if (val == 'add') { |
|
|
|
// 新增 |
|
|
|
openForm('create') |
|
|
|
} else if (val == 'import') { // 导入 |
|
|
|
} else if (val == 'import') { |
|
|
|
// 导入 |
|
|
|
handleImport() |
|
|
|
} else if (val == 'export') { // 导出 |
|
|
|
} else if (val == 'export') { |
|
|
|
// 导出 |
|
|
|
handleExport() |
|
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
|
} else if (val == 'refresh') { |
|
|
|
// 刷新 |
|
|
|
getList() |
|
|
|
} else if (val == 'filtrate') { // 筛选 |
|
|
|
} else { // 其他按钮 |
|
|
|
} else if (val == 'filtrate') { |
|
|
|
// 筛选 |
|
|
|
} else { |
|
|
|
// 其他按钮 |
|
|
|
console.log('其他按钮', item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:configurationsetting:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:configurationsetting:delete'}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn({ hasPermi: 'wms:configurationsetting:update' }), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:configurationsetting:delete' }) // 删除 |
|
|
|
] |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
// const res = await ConfigurationsettingApi.getItempackaging(row.id) |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
|
} else if (val == 'delete') { |
|
|
|
// 删除 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
} |
|
|
@ -144,6 +161,18 @@ const basicFormRef = ref() |
|
|
|
const openForm = (type: string, row?: any) => { |
|
|
|
basicFormRef.value.open(type, row) |
|
|
|
} |
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType, data) => { |
|
|
|
if (formType === 'create') { |
|
|
|
await ConfigurationsettingApi.createConfigurationsetting(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await ConfigurationsettingApi.updateConfigurationsetting(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
@ -203,12 +232,12 @@ const searchFormClick = (searchData) => { |
|
|
|
} |
|
|
|
getList() // 刷新当前列表 |
|
|
|
} |
|
|
|
const formatter = (type)=>{ |
|
|
|
let str = getStrDictOptions(DICT_TYPE.STRATEGY_TYPE).filter(item=>type==item.value)[0].label; |
|
|
|
return str |
|
|
|
const formatter = (type) => { |
|
|
|
let str = getStrDictOptions(DICT_TYPE.STRATEGY_TYPE).filter((item) => type == item.value)[0].label |
|
|
|
return str |
|
|
|
} |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async() => { |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await ConfigurationsettingApi.importTemplate() |
|
|
|
}) |
|
|
|