|
@ -1,7 +1,7 @@ |
|
|
<template> |
|
|
<template> |
|
|
<ContentWrap> |
|
|
<ContentWrap> |
|
|
<!-- 搜索工作栏 --> |
|
|
<!-- 搜索工作栏 --> |
|
|
<Search :schema="RelegateRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
<Search :schema="[...RelegateRecordMain.allSchemas.searchSchema, ...RelegateRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
</ContentWrap> |
|
|
</ContentWrap> |
|
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
<!-- 列表头部 --> |
|
@ -27,9 +27,9 @@ |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:currentPage="tableObject.currentPage" |
|
|
v-model:sort="tableObject.sort" |
|
|
v-model:sort="tableObject.sort" |
|
|
> |
|
|
> |
|
|
<template #code="{row}"> |
|
|
<template #number="{row}"> |
|
|
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|
|
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)"> |
|
|
<span>{{ row.code }}</span> |
|
|
<span>{{ row.number }}</span> |
|
|
</el-button> |
|
|
</el-button> |
|
|
</template> |
|
|
</template> |
|
|
<template #action="{ row }"> |
|
|
<template #action="{ row }"> |
|
@ -41,29 +41,44 @@ |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
<BasicForm |
|
|
<BasicForm |
|
|
ref="basicFormRef" |
|
|
ref="basicFormRef" |
|
|
@success="formsSuccess" |
|
|
:isOpenSearchTable="true" |
|
|
|
|
|
@success="getList" |
|
|
:rules="RelegateRecordMainRules" |
|
|
:rules="RelegateRecordMainRules" |
|
|
:formAllSchemas="RelegateRecordMain.allSchemas" |
|
|
:formAllSchemas="RelegateRecordMain.allSchemas" |
|
|
|
|
|
:tableAllSchemas="RelegateRecordDetail.allSchemas" |
|
|
|
|
|
:tableFormRules="RelegateRecordDetailRules" |
|
|
:apiUpdate="RelegateRecordMainApi.updateRelegateRecordMain" |
|
|
:apiUpdate="RelegateRecordMainApi.updateRelegateRecordMain" |
|
|
:apiCreate="RelegateRecordMainApi.createRelegateRecordMain" |
|
|
:apiCreate="RelegateRecordMainApi.createRelegateRecordMain" |
|
|
|
|
|
:isBusiness="true" |
|
|
|
|
|
fromeWhere="RelegateRecordMain" |
|
|
|
|
|
@submitForm="submitForm" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="false" |
|
|
|
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
<!-- 详情 --> |
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="RelegateRecordMain.allSchemas" /> |
|
|
<Detail |
|
|
|
|
|
ref="detailRef" |
|
|
<!-- 导入 --> |
|
|
:isBasic="true" |
|
|
<ImportForm ref="importFormRef" url="/wms/relegate-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
:allSchemas="RelegateRecordMain.allSchemas" |
|
|
|
|
|
:detailAllSchemas="RelegateRecordDetail.allSchemas" |
|
|
|
|
|
:detailAllSchemasRules="RelegateRecordDetailRules" |
|
|
|
|
|
:apiCreate="RelegateRecordDetailApi.createRelegateRecordDetail" |
|
|
|
|
|
:apiUpdate="RelegateRecordDetailApi.updateRelegateRecordDetail" |
|
|
|
|
|
:apiPage="RelegateRecordDetailApi.getRelegateRecordDetailPage" |
|
|
|
|
|
:apiDelete="RelegateRecordDetailApi.deleteRelegateRecordDetail" |
|
|
|
|
|
fromeWhere="RelegateRecordMain" |
|
|
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
|
|
:detailButtonIsShowAdd="true" |
|
|
|
|
|
:detailButtonIsShowDelete="true" /> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import download from '@/utils/download' |
|
|
import download from '@/utils/download' |
|
|
import { RelegateRecordMain,RelegateRecordMainRules } from './relegate-record-main.data' |
|
|
import { RelegateRecordMain,RelegateRecordMainRules,RelegateRecordDetail,RelegateRecordDetailRules } from './relegateRecordMain.data' |
|
|
import * as RelegateRecordMainApi from '@/api/wms/relegateRecordMain' |
|
|
import * as RelegateRecordMainApi from '@/api/wms/relegateRecordMain' |
|
|
|
|
|
import * as RelegateRecordDetailApi from '@/api/wms/relegateRecordDetail' |
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
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 Detail from '@/components/Detail/src/Detail.vue' |
|
|
|
|
|
|
|
|
defineOptions({ name: 'RelegateRecordMain' }) |
|
|
defineOptions({ name: 'RelegateRecordMain' }) |
|
@ -74,7 +89,8 @@ const { t } = useI18n() // 国际化 |
|
|
const route = useRoute() // 路由信息 |
|
|
const route = useRoute() // 路由信息 |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(RelegateRecordMain.allSchemas.tableColumns) |
|
|
const tableColumns = ref([...RelegateRecordMain.allSchemas.tableColumns,...RelegateRecordDetail.allSchemas.tableMainColumns]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
@ -85,13 +101,22 @@ const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回——详情 |
|
|
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
const setV = {} |
|
|
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
|
|
formRef.setValues(setV) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 字段设置 更新主列表字段 |
|
|
// 字段设置 更新主列表字段 |
|
|
const updataTableColumns = (val) => { |
|
|
const updataTableColumns = (val) => { |
|
|
tableColumns.value = val |
|
|
tableColumns.value = val |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
getListApi: RelegateRecordMainApi.getRelegateRecordMainPage // 分页接口 |
|
|
getListApi: RelegateRecordDetailApi.getRelegateRecordDetailPage // 分页接口 |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
// 获得表格的各种操作 |
|
@ -119,8 +144,6 @@ const HeadButttondata = [ |
|
|
const buttonBaseClick = (val, item) => { |
|
|
const buttonBaseClick = (val, item) => { |
|
|
if (val == 'add') { // 新增 |
|
|
if (val == 'add') { // 新增 |
|
|
openForm('create') |
|
|
openForm('create') |
|
|
} else if (val == 'import') { // 导入 |
|
|
|
|
|
handleImport() |
|
|
|
|
|
} else if (val == 'export') { // 导出 |
|
|
} else if (val == 'export') { // 导出 |
|
|
handleExport() |
|
|
handleExport() |
|
|
} else if (val == 'refresh') { // 刷新 |
|
|
} else if (val == 'refresh') { // 刷新 |
|
@ -152,19 +175,16 @@ const openForm = (type: string, row?: any) => { |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* tableForm方法 |
|
|
|
|
|
*/ |
|
|
|
|
|
const tableFormKeys = {} |
|
|
|
|
|
RelegateRecordDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
|
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// form表单提交 |
|
|
// form表单提交 |
|
|
const formsSuccess = async (formType,data) => { |
|
|
const submitForm = async (formType,data) => { |
|
|
var isHave =RelegateRecordMain.allSchemas.formSchema.some(function (item) { |
|
|
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
|
|
}); |
|
|
|
|
|
if(isHave){ |
|
|
|
|
|
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){ |
|
|
|
|
|
message.error('失效时间要大于生效时间') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|
await RelegateRecordMainApi.createRelegateRecordMain(data) |
|
|
await RelegateRecordMainApi.createRelegateRecordMain(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
@ -211,20 +231,6 @@ const handleExport = async () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
|
|
const importFormRef = ref() |
|
|
|
|
|
const handleImport = () => { |
|
|
|
|
|
importFormRef.value.open() |
|
|
|
|
|
} |
|
|
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
|
|
const importTemplateData = reactive({ |
|
|
|
|
|
templateUrl: '', |
|
|
|
|
|
templateTitle: '物料降级记录主导入模版.xlsx' |
|
|
|
|
|
}) |
|
|
|
|
|
// 导入成功之后 |
|
|
|
|
|
const importSuccess = () => { |
|
|
|
|
|
getList() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 筛选提交 |
|
|
// 筛选提交 |
|
|
const searchFormClick = (searchData) => { |
|
|
const searchFormClick = (searchData) => { |
|
@ -238,7 +244,6 @@ const searchFormClick = (searchData) => { |
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
importTemplateData.templateUrl = await RelegateRecordMainApi.importTemplate() |
|
|
|
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|