Browse Source

添加客户模具分摊对账单预测

syhx
zhang_li 2 months ago
parent
commit
47577083fc
  1. 56
      src/api/wms/customerToolApportStatementForecastDetail/index.ts
  2. 52
      src/api/wms/customerToolApportStatementForecastMain/index.ts
  3. 173
      src/views/wms/deliversettlementManage/customerStatement/customerToolApportStatement/customerToolApportStatementDetail.data.ts
  4. 4
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts
  5. 0
      src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue
  6. 94
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts
  7. 54
      src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue

56
src/api/wms/customerToolApportStatementForecastDetail/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface CustomerToolApportStatementForecastDetailVO {
id: number
number: string
masterId: number
factoryCode: string
factoryName: string
invoiceNumber: string
articleNumber: string
vehicleType: string
forecastAllocationAmount: number
remark: string
available: string
}
// 查询客户模具分摊对账单预测子表(WMS)列表
export const getCustomerToolApportStatementForecastDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-tool-apport-statement-forecast-detail/senior', data })
} else {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-detail/page`, params })
}
}
// 查询客户模具分摊对账单预测子表(WMS)详情
export const getCustomerToolApportStatementForecastDetail = async (id: number) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-detail/get?id=` + id })
}
// 新增客户模具分摊对账单预测子表(WMS)
export const createCustomerToolApportStatementForecastDetail = async (data: CustomerToolApportStatementForecastDetailVO) => {
return await request.post({ url: `/wms/customer-tool-apport-statement-forecast-detail/create`, data })
}
// 修改客户模具分摊对账单预测子表(WMS)
export const updateCustomerToolApportStatementForecastDetail = async (data: CustomerToolApportStatementForecastDetailVO) => {
return await request.put({ url: `/wms/customer-tool-apport-statement-forecast-detail/update`, data })
}
// 删除客户模具分摊对账单预测子表(WMS)
export const deleteCustomerToolApportStatementForecastDetail = async (id: number) => {
return await request.delete({ url: `/wms/customer-tool-apport-statement-forecast-detail/delete?id=` + id })
}
// 导出客户模具分摊对账单预测子表(WMS) Excel
export const exportCustomerToolApportStatementForecastDetail = async (params) => {
return await request.download({ url: `/wms/customer-tool-apport-statement-forecast-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-tool-apport-statement-forecast-detail/get-import-template' })
}

52
src/api/wms/customerToolApportStatementForecastMain/index.ts

@ -0,0 +1,52 @@
import request from '@/config/axios'
export interface CustomerToolApportStatementForecastMainVO {
id: number
number: string
customerCode: string
customerName: string
yearsMonth: Date
remark: string
available: string
}
// 查询客户模具分摊对账单预测主表(WMS)列表
export const getCustomerToolApportStatementForecastMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/customer-tool-apport-statement-forecast-main/senior', data })
} else {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-main/page`, params })
}
}
// 查询客户模具分摊对账单预测主表(WMS)详情
export const getCustomerToolApportStatementForecastMain = async (id: number) => {
return await request.get({ url: `/wms/customer-tool-apport-statement-forecast-main/get?id=` + id })
}
// 新增客户模具分摊对账单预测主表(WMS)
export const createCustomerToolApportStatementForecastMain = async (data: CustomerToolApportStatementForecastMainVO) => {
return await request.post({ url: `/wms/customer-tool-apport-statement-forecast-main/create`, data })
}
// 修改客户模具分摊对账单预测主表(WMS)
export const updateCustomerToolApportStatementForecastMain = async (data: CustomerToolApportStatementForecastMainVO) => {
return await request.put({ url: `/wms/customer-tool-apport-statement-forecast-main/update`, data })
}
// 删除客户模具分摊对账单预测主表(WMS)
export const deleteCustomerToolApportStatementForecastMain = async (id: number) => {
return await request.delete({ url: `/wms/customer-tool-apport-statement-forecast-main/delete?id=` + id })
}
// 导出客户模具分摊对账单预测主表(WMS) Excel
export const exportCustomerToolApportStatementForecastMain = async (params) => {
return await request.download({ url: `/wms/customer-tool-apport-statement-forecast-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/customer-tool-apport-statement-forecast-main/get-import-template' })
}

173
src/views/wms/deliversettlementManage/customerStatement/customerToolApportStatement/customerToolApportStatementDetail.data.ts

@ -1,173 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CustomerToolApportStatementDetailRules = reactive({
invoiceNumber: [required],
articleNumber: [required],
vehicleType: [required],
amount: [required],
qty: [required],
allocationPrice: [required],
adjustmentAmount: [required],
})
export const CustomerToolApportStatementDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '客户对账单单据号',
field: 'customerStatementNumber',
sort: 'custom',
isSearch: true,
},
{
label: '年月预留字段',
field: 'yearsMonth',
sort: 'custom',
},
{
label: '客户对账单主id',
field: 'masterId',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '账票号',
field: 'invoiceNumber',
sort: 'custom',
isSearch: true,
},
{
label: '品号',
field: 'articleNumber',
sort: 'custom',
isSearch: true,
},
{
label: '车型',
field: 'vehicleType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '金额',
field: 'amount',
sort: 'custom',
},
{
label: '数量',
field: 'qty',
sort: 'custom',
},
{
label: '模具分摊单价',
field: 'allocationPrice',
sort: 'custom',
},
{
label: '调整金额',
field: 'adjustmentAmount',
sort: 'custom',
},
{
label: '确认分摊时间',
field: 'verifyTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '已作废时间',
field: 'abrogateTime',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '0:新增1:已作废',
field: 'status',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '版本号',
field: 'versionNumber',
sort: 'custom',
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isTable: false,
isSearch: true,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isTable: false,
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

4
src/views/wms/deliversettlementManage/customerStatement/customerStatement/customerStatementMain.data.ts → src/views/wms/deliversettlementManage/moldAllocation/customerStatement/customerStatementMain.data.ts

@ -33,7 +33,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '客户名称',
field: 'customerName',
sort: 'custom',
isSearch: true,
isSearch: false,
},
{
label: '年月',
@ -223,7 +223,7 @@ export const CustomerStatementMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isSearch: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},

0
src/views/wms/deliversettlementManage/customerStatement/customerStatement/index.vue → src/views/wms/deliversettlementManage/moldAllocation/customerStatement/index.vue

94
src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/customerToolApportStatementForecastMain.data.ts

@ -0,0 +1,94 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const CustomerToolApportStatementForecastMainRules = reactive({
customerCode: [required],
customerName: [required],
yearsMonth: [required],
})
export const CustomerToolApportStatementForecastMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '客户代码',
field: 'customerCode',
sort: 'custom',
isSearch: true,
},
{
label: '客户名称',
field: 'customerName',
sort: 'custom',
isSearch: false,
},
{
label: '年月',
field: 'yearsMonth',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '是否可用默认TRUE',
field: 'available',
sort: 'custom',
isTable:false
},
{
label: '创建者',
field: 'creater',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
isTable:false,
table: {
width: 150,
fixed: 'right'
}
}
]))

54
src/views/wms/deliversettlementManage/customerStatement/customerToolApportStatement/index.vue → src/views/wms/deliversettlementManage/moldAllocation/customerToolApportStatementForecastMain/index.vue

@ -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>
Loading…
Cancel
Save