|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<ContentWrap> |
|
|
|
<!-- 搜索工作栏 --> |
|
|
|
<Search :schema="CustomerToolApportStatementDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
<Search :schema="CustomerToolApportStatementForecastMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 列表头部 --> |
|
|
@ -11,7 +11,7 @@ |
|
|
|
:routeName="routeName" |
|
|
|
@updataTableColumns="updataTableColumns" |
|
|
|
@searchFormClick="searchFormClick" |
|
|
|
:allSchemas="CustomerToolApportStatementDetail.allSchemas" |
|
|
|
:allSchemas="CustomerToolApportStatementForecastMain.allSchemas" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 列表 --> |
|
|
@ -42,31 +42,31 @@ |
|
|
|
<BasicForm |
|
|
|
ref="basicFormRef" |
|
|
|
@success="formsSuccess" |
|
|
|
:rules="CustomerToolApportStatementDetailRules" |
|
|
|
:formAllSchemas="CustomerToolApportStatementDetail.allSchemas" |
|
|
|
:apiUpdate="CustomerToolApportStatementDetailApi.updateCustomerToolApportStatementDetail" |
|
|
|
:apiCreate="CustomerToolApportStatementDetailApi.createCustomerToolApportStatementDetail" |
|
|
|
:rules="CustomerToolApportStatementForecastMainRules" |
|
|
|
:formAllSchemas="CustomerToolApportStatementForecastMain.allSchemas" |
|
|
|
:apiUpdate="CustomerToolApportStatementForecastMainApi.updateCustomerToolApportStatementForecastMain" |
|
|
|
:apiCreate="CustomerToolApportStatementForecastMainApi.createCustomerToolApportStatementForecastMain" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
:isBusiness="false" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- 详情 --> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerToolApportStatementDetail.allSchemas" /> |
|
|
|
<Detail ref="detailRef" :isBasic="true" :allSchemas="CustomerToolApportStatementForecastMain.allSchemas" /> |
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/customer-tool-apport-statement-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
<ImportForm ref="importFormRef" url="/wms/customer-tool-apport-statement-forecast-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import download from '@/utils/download' |
|
|
|
import { CustomerToolApportStatementDetail,CustomerToolApportStatementDetailRules } from './customerToolApportStatementDetail.data' |
|
|
|
import * as CustomerToolApportStatementDetailApi from '@/api/wms/customerToolApportStatementDetail' |
|
|
|
import { CustomerToolApportStatementForecastMain,CustomerToolApportStatementForecastMainRules } from './customerToolApportStatementForecastMain.data' |
|
|
|
import * as CustomerToolApportStatementForecastMainApi from '@/api/wms/customerToolApportStatementForecastMain' |
|
|
|
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: 'CustomerToolApportStatementDetail' }) |
|
|
|
defineOptions({ name: 'CustomerToolApportStatementForecastMain' }) |
|
|
|
|
|
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
const { t } = useI18n() // 国际化 |
|
|
@ -74,7 +74,7 @@ const { t } = useI18n() // 国际化 |
|
|
|
const route = useRoute() // 路由信息 |
|
|
|
const routeName = ref() |
|
|
|
routeName.value = route.name |
|
|
|
const tableColumns = ref(CustomerToolApportStatementDetail.allSchemas.tableColumns) |
|
|
|
const tableColumns = ref(CustomerToolApportStatementForecastMain.allSchemas.tableColumns) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
@ -91,7 +91,7 @@ const updataTableColumns = (val) => { |
|
|
|
} |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: CustomerToolApportStatementDetailApi.getCustomerToolApportStatementDetailPage // 分页接口 |
|
|
|
getListApi: CustomerToolApportStatementForecastMainApi.getCustomerToolApportStatementForecastMainPage // 分页接口 |
|
|
|
}) |
|
|
|
|
|
|
|
// 获得表格的各种操作 |
|
|
@ -99,9 +99,9 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:customerToolApportStatementDetail:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:customerToolApportStatementDetail:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:customerToolApportStatementDetail:export'}), // 导出 |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:customerToolApportStatementForecastMain:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:customerToolApportStatementForecastMain:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:customerToolApportStatementForecastMain:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
@ -133,8 +133,8 @@ const buttonBaseClick = (val, item) => { |
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = [ |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:customerToolApportStatementDetail:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerToolApportStatementDetail:delete'}), // 删除 |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:customerToolApportStatementForecastMain:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:customerToolApportStatementForecastMain:delete'}), // 删除 |
|
|
|
] |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
@ -154,7 +154,7 @@ const openForm = (type: string, row?: any) => { |
|
|
|
|
|
|
|
// form表单提交 |
|
|
|
const formsSuccess = async (formType,data) => { |
|
|
|
var isHave =CustomerToolApportStatementDetail.allSchemas.formSchema.some(function (item) { |
|
|
|
var isHave =CustomerToolApportStatementForecastMain.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'activeTime' || item.field === 'expireTime'; |
|
|
|
}); |
|
|
|
if(isHave){ |
|
|
@ -166,10 +166,10 @@ const formsSuccess = async (formType,data) => { |
|
|
|
if(data.activeTime==0)data.activeTime = null; |
|
|
|
if(data.expireTime==0)data.expireTime = null; |
|
|
|
if (formType === 'create') { |
|
|
|
await CustomerToolApportStatementDetailApi.createCustomerToolApportStatementDetail(data) |
|
|
|
await CustomerToolApportStatementForecastMainApi.createCustomerToolApportStatementForecastMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await CustomerToolApportStatementDetailApi.updateCustomerToolApportStatementDetail(data) |
|
|
|
await CustomerToolApportStatementForecastMainApi.updateCustomerToolApportStatementForecastMain(data) |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
} |
|
|
|
basicFormRef.value.dialogVisible = false |
|
|
@ -179,7 +179,7 @@ const formsSuccess = async (formType,data) => { |
|
|
|
/** 详情操作 */ |
|
|
|
const detailRef = ref() |
|
|
|
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerToolApportStatementDetail') |
|
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicCustomerToolApportStatementForecastMain') |
|
|
|
} |
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
@ -188,7 +188,7 @@ const handleDelete = async (id: number) => { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
// 发起删除 |
|
|
|
await CustomerToolApportStatementDetailApi.deleteCustomerToolApportStatementDetail(id) |
|
|
|
await CustomerToolApportStatementForecastMainApi.deleteCustomerToolApportStatementForecastMain(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
@ -203,8 +203,8 @@ const handleExport = async () => { |
|
|
|
await message.exportConfirm() |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await CustomerToolApportStatementDetailApi.exportCustomerToolApportStatementDetail(tableObject.params) |
|
|
|
download.excel(data, '客户模具分摊对账单明细表(WMS).xlsx') |
|
|
|
const data = await CustomerToolApportStatementForecastMainApi.exportCustomerToolApportStatementForecastMain(tableObject.params) |
|
|
|
download.excel(data, '客户模具分摊对账单预测主表(WMS).xlsx') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -219,7 +219,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '客户模具分摊对账单明细表(WMS)导入模版.xlsx' |
|
|
|
templateTitle: '客户模具分摊对账单预测主表(WMS)导入模版.xlsx' |
|
|
|
}) |
|
|
|
// 导入成功之后 |
|
|
|
const importSuccess = () => { |
|
|
@ -238,7 +238,7 @@ const searchFormClick = (searchData) => { |
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|
importTemplateData.templateUrl = await CustomerToolApportStatementDetailApi.importTemplate() |
|
|
|
importTemplateData.templateUrl = await CustomerToolApportStatementForecastMainApi.importTemplate() |
|
|
|
}) |
|
|
|
|
|
|
|
</script> |