Browse Source

已发已结记录

intex
yufei_wang 2 days ago
parent
commit
031061c6a2
  1. 60
      src/api/wms/finishedShipmentDetail/index.ts
  2. 56
      src/api/wms/finishedShipmentMain/index.ts
  3. 85
      src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/finishedShipmentMain.data.ts
  4. 48
      src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/index.vue
  5. 1
      src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/index.vue
  6. 43
      src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/unfinishedShipmentMain.data.ts
  7. 244
      src/views/wms/deliversettlementManage/unfinishedShipmentDetail1/index.vue
  8. 151
      src/views/wms/deliversettlementManage/unfinishedShipmentDetail1/unfinishedShipmentDetail.data.ts

60
src/api/wms/finishedShipmentDetail/index.ts

@ -0,0 +1,60 @@
import request from '@/config/axios'
export interface FinishedShipmentDetailVO {
id: number
masterId: number
materialCode: string
materialName: string
backNumber: string
materialDescription: string
shipmentQuantity: number
unitPrice: number
lockedQuantity: number
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询已发未结发货记录子列表
export const getFinishedShipmentDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/finished-shipment-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/finished-shipment-record-detail/page`, params })
}
}
// 查询已发未结发货记录子详情
export const getFinishedShipmentDetail = async (id: number) => {
return await request.get({ url: `/wms/finished-shipment-record-detail/get?id=` + id })
}
// 新增已发未结发货记录子
export const createFinishedShipmentDetail = async (data: FinishedShipmentDetailVO) => {
return await request.post({ url: `/wms/finished-shipment-record-detail/create`, data })
}
// 修改已发未结发货记录子
export const updateFinishedShipmentDetail = async (data: FinishedShipmentDetailVO) => {
return await request.put({ url: `/wms/finished-shipment-record-detail/update`, data })
}
// 删除已发未结发货记录子
export const deleteFinishedShipmentDetail = async (id: number) => {
return await request.delete({ url: `/wms/finished-shipment-record-detail/delete?id=` + id })
}
// 导出已发未结发货记录子 Excel
export const exportFinishedShipmentDetail = async (params) => {
return await request.download({ url: `/wms/finished-shipment-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/finished-shipment-record-detail/get-import-template' })
}

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

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface FinishedShipmentMainVO {
id: number
orderNumber: string
shipmentRecordNumber: string
shipmentType: string
customerOrderNumber: string
available: string
deletionTime: Date
deleterId: string
extraProperties: string
concurrencyStamp: number
siteId: string
}
// 查询已发未结发货记录主列表
export const getFinishedShipmentMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/finished-shipment-record-main/senior', data })
} else {
return await request.get({ url: `/wms/finished-shipment-record-main/page`, params })
}
}
// 查询已发未结发货记录主详情
export const getFinishedShipmentMain = async (id: number) => {
return await request.get({ url: `/wms/finished-shipment-record-main/get?id=` + id })
}
// 新增已发未结发货记录主
export const createFinishedShipmentMain = async (data: FinishedShipmentMainVO) => {
return await request.post({ url: `/wms/finished-shipment-record-main/create`, data })
}
// 修改已发未结发货记录主
export const updateFinishedShipmentMain = async (data: FinishedShipmentMainVO) => {
return await request.put({ url: `/wms/finished-shipment-record-main/update`, data })
}
// 删除已发未结发货记录主
export const deleteFinishedShipmentMain = async (id: number) => {
return await request.delete({ url: `/wms/finished-shipment-record-main/delete?id=` + id })
}
// 导出已发未结发货记录主 Excel
export const exportFinishedShipmentMain = async (params) => {
return await request.download({ url: `/wms/finished-shipment-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/finished-shipment-record-main/get-import-template' })
}

85
src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/finishedShipmentMain.data.ts

@ -2,7 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const UnfinishedShipmentMainRules = reactive({ export const FinishedShipmentMainRules = reactive({
orderNumber: [required], orderNumber: [required],
shipmentRecordNumber: [required], shipmentRecordNumber: [required],
shipmentType: [required], shipmentType: [required],
@ -11,7 +11,7 @@ export const UnfinishedShipmentMainRules = reactive({
concurrencyStamp: [required] concurrencyStamp: [required]
}) })
export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([ export const FinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '单据号', label: '单据号',
@ -22,6 +22,15 @@ export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isSearch: true isSearch: true
}, },
{
label: '已发未结记录单号',
field: 'unfinishedNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{ {
label: '发货记录单号', label: '发货记录单号',
field: 'shipmentRecordNumber', field: 'shipmentRecordNumber',
@ -32,7 +41,7 @@ export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true isSearch: true
}, },
{ {
label: '发货方式', label: '发货类型',
field: 'shipmentType', field: 'shipmentType',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -69,7 +78,7 @@ export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验 // 表单校验
export const UnfinishedShipmentDetailRules = reactive({ export const FinishedShipmentDetailRules = reactive({
materialCode: [required], materialCode: [required],
materialName: [required], materialName: [required],
backNumber: [required], backNumber: [required],
@ -81,7 +90,7 @@ export const UnfinishedShipmentDetailRules = reactive({
concurrencyStamp: [required] concurrencyStamp: [required]
}) })
export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const FinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '物料代码', label: '物料代码',
@ -126,9 +135,36 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
// {
// label: '发货数量',
// field: 'shipmentQuantity',
// sort: 'custom',
// table: {
// width: 150,
// },
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
// {
// label: '锁定数量',
// field: 'lockedQuantity',
// sort: 'custom',
// table: {
// width: 150,
// },
// isSearch: true,
// form: {
// component: 'InputNumber',
// value: 0
// }
// },
{ {
label: '发货数量', label: '已结数量',
field: 'shipmentQuantity', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150, width: 150,
@ -148,36 +184,6 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isSearch: true isSearch: true
}, },
{
label: '锁定数量',
field: 'lockedQuantity',
sort: 'custom',
table: {
width: 150,
},
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
@ -195,7 +201,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false isForm: false,
hiddenInMain:true
}, },
{ {
label: '创建人', label: '创建人',
@ -205,6 +212,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
isTable: true, isTable: true,
hiddenInMain:true
}, },
// { // {
// label: '操作', // label: '操作',

48
src/views/wms/deliversettlementManage/saleEstimate/finishedShipmentMain/index.vue

@ -1,7 +1,7 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...UnfinishedShipmentMain.allSchemas.searchSchema,...UnfinishedShipmentDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" /> <Search :schema="[...FinishedShipmentMain.allSchemas.searchSchema,...FinishedShipmentDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -11,8 +11,8 @@
:routeName="routeName" :routeName="routeName"
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="UnfinishedShipmentMain.allSchemas" :allSchemas="FinishedShipmentMain.allSchemas"
:detailAllSchemas="UnfinishedShipmentDetail.allSchemas" :detailAllSchemas="FinishedShipmentDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -43,10 +43,10 @@
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="formsSuccess" @success="formsSuccess"
:rules="UnfinishedShipmentMainRules" :rules="FinishedShipmentMainRules"
:formAllSchemas="UnfinishedShipmentMain.allSchemas" :formAllSchemas="FinishedShipmentMain.allSchemas"
:apiUpdate="UnfinishedShipmentMainApi.updateUnfinishedShipmentMain" :apiUpdate="FinishedShipmentMainApi.updateFinishedShipmentMain"
:apiCreate="UnfinishedShipmentMainApi.createUnfinishedShipmentMain" :apiCreate="FinishedShipmentMainApi.createFinishedShipmentMain"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
/> />
@ -55,10 +55,10 @@
<Detail <Detail
ref="detailRef" ref="detailRef"
:isBasic="false" :isBasic="false"
:allSchemas="UnfinishedShipmentMain.allSchemas" :allSchemas="FinishedShipmentMain.allSchemas"
:detailAllSchemas="UnfinishedShipmentDetail.allSchemas" :detailAllSchemas="FinishedShipmentDetail.allSchemas"
:detailAllSchemasRules="UnfinishedShipmentDetailRules" :detailAllSchemasRules="FinishedShipmentDetailRules"
:apiPage="UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage" :apiPage="FinishedShipmentDetailApi.getFinishedShipmentDetailPage"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -67,15 +67,15 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { UnfinishedShipmentMain,UnfinishedShipmentMainRules,UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from './finishedShipmentMain.data' import { FinishedShipmentMain,FinishedShipmentMainRules,FinishedShipmentDetail,FinishedShipmentDetailRules } from './finishedShipmentMain.data'
import * as UnfinishedShipmentMainApi from '@/api/wms/unfinishedShipmentMain' import * as FinishedShipmentMainApi from '@/api/wms/finishedShipmentMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail' import * as FinishedShipmentDetailApi from '@/api/wms/finishedShipmentDetail'
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 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: 'UnfinishedShipmentMain' }) defineOptions({ name: 'FinishedShipmentMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
@ -83,7 +83,7 @@ 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([...UnfinishedShipmentMain.allSchemas.tableColumns,...UnfinishedShipmentDetail.allSchemas.tableMainColumns]) const tableColumns = ref([...FinishedShipmentMain.allSchemas.tableColumns,...FinishedShipmentDetail.allSchemas.tableMainColumns])
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -100,7 +100,7 @@ const updataTableColumns = (val) => {
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage // getListApi: FinishedShipmentDetailApi.getFinishedShipmentDetailPage //
}) })
// //
@ -163,7 +163,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =UnfinishedShipmentMain.allSchemas.formSchema.some(function (item) { var isHave =FinishedShipmentMain.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
if(isHave){ if(isHave){
@ -175,10 +175,10 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') { if (formType === 'create') {
await UnfinishedShipmentMainApi.createUnfinishedShipmentMain(data) await FinishedShipmentMainApi.createFinishedShipmentMain(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await UnfinishedShipmentMainApi.updateUnfinishedShipmentMain(data) await FinishedShipmentMainApi.updateFinishedShipmentMain(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
basicFormRef.value.dialogVisible = false basicFormRef.value.dialogVisible = false
@ -188,7 +188,7 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicUnfinishedShipmentMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicFinishedShipmentMain')
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@ -197,7 +197,7 @@ const handleDelete = async (id: number) => {
// //
await message.delConfirm() await message.delConfirm()
// //
await UnfinishedShipmentMainApi.deleteUnfinishedShipmentMain(id) await FinishedShipmentMainApi.deleteFinishedShipmentMain(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()
@ -212,7 +212,7 @@ const handleExport = async () => {
await message.exportConfirm() await message.exportConfirm()
// //
exportLoading.value = true exportLoading.value = true
const data = await UnfinishedShipmentMainApi.exportUnfinishedShipmentMain(tableObject.params) const data = await FinishedShipmentMainApi.exportFinishedShipmentMain(tableObject.params)
download.excel(data, '已发未结发货记录主.xlsx') download.excel(data, '已发未结发货记录主.xlsx')
} catch { } catch {
} finally { } finally {
@ -247,7 +247,7 @@ const searchFormClick = (searchData) => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()
importTemplateData.templateUrl = await UnfinishedShipmentMainApi.importTemplate() importTemplateData.templateUrl = await FinishedShipmentMainApi.importTemplate()
}) })
</script> </script>

1
src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/index.vue

@ -101,6 +101,7 @@ const updataTableColumns = (val) => {
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage // getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage //
}) })
// //

43
src/views/wms/deliversettlementManage/saleEstimate/unfinishedShipmentMain/unfinishedShipmentMain.data.ts

@ -32,7 +32,7 @@ export const UnfinishedShipmentMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true isSearch: true
}, },
{ {
label: '发货方式', label: '发货类型',
field: 'shipmentType', field: 'shipmentType',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
@ -139,15 +139,7 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
value: 0 value: 0
} }
}, },
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{ {
label: '锁定数量', label: '锁定数量',
field: 'lockedQuantity', field: 'lockedQuantity',
@ -161,23 +153,15 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
value: 0 value: 0
} }
}, },
// { {
// label: '是否可用', label: '销售单价',
// field: 'available', field: 'unitPrice',
// sort: 'custom', sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE, table: {
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑 width: 150,
// isSearch: true, },
// form: { isSearch: true
// component: 'Switch', },
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
@ -195,7 +179,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
} }
}, },
isForm: false isForm: false,
hiddenInMain:true
}, },
{ {
label: '创建人', label: '创建人',
@ -205,6 +190,8 @@ export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
isTable: true, isTable: true,
hiddenInMain:true
}, },
// { // {
// label: '操作', // label: '操作',

244
src/views/wms/deliversettlementManage/unfinishedShipmentDetail1/index.vue

@ -1,244 +0,0 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="UnfinishedShipmentDetail.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="UnfinishedShipmentDetail.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="formsSuccess"
:rules="UnfinishedShipmentDetailRules"
:formAllSchemas="UnfinishedShipmentDetail.allSchemas"
:apiUpdate="UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail"
:apiCreate="UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="UnfinishedShipmentDetail.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/unfinished-shipment-detail/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { UnfinishedShipmentDetail,UnfinishedShipmentDetailRules } from './unfinishedShipmentDetail.data'
import * as UnfinishedShipmentDetailApi from '@/api/wms/unfinishedShipmentDetail'
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: 'UnfinishedShipmentDetail' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(UnfinishedShipmentDetail.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
const { tableObject, tableMethods } = useTable({
getListApi: UnfinishedShipmentDetailApi.getUnfinishedShipmentDetailPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:unfinishedShipmentDetail:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:unfinishedShipmentDetail:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:unfinishedShipmentDetail:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:unfinishedShipmentDetail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:unfinishedShipmentDetail:delete'}), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
var isHave =UnfinishedShipmentDetail.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') {
await UnfinishedShipmentDetailApi.createUnfinishedShipmentDetail(data)
message.success(t('common.createSuccess'))
} else {
await UnfinishedShipmentDetailApi.updateUnfinishedShipmentDetail(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicUnfinishedShipmentDetail')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await UnfinishedShipmentDetailApi.deleteUnfinishedShipmentDetail(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await UnfinishedShipmentDetailApi.exportUnfinishedShipmentDetail(tableObject.params)
download.excel(data, '已发未结发货记录子.xlsx')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '已发未结发货记录子导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await UnfinishedShipmentDetailApi.importTemplate()
})
</script>

151
src/views/wms/deliversettlementManage/unfinishedShipmentDetail1/unfinishedShipmentDetail.data.ts

@ -1,151 +0,0 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const UnfinishedShipmentDetailRules = reactive({
materialCode: [required],
materialName: [required],
backNumber: [required],
materialDescription: [required],
shipmentQuantity: [required],
unitPrice: [required],
lockedQuantity: [required],
available: [required],
concurrencyStamp: [required]
})
export const UnfinishedShipmentDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isSearch: true
},
{
label: '背番',
field: 'backNumber',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '物料描述',
field: 'itemDescription',
sort: 'custom',
table: {
width: 150,
},
isSearch: true,
form: {
component: 'Editor',
componentProps: {
valueHtml: '',
height: 200
}
}
},
{
label: '发货数量',
field: 'shipmentQuantity',
sort: 'custom',
table: {
width: 150,
},
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
{
label: '销售单价',
field: 'unitPrice',
sort: 'custom',
table: {
width: 150,
},
isSearch: true
},
{
label: '锁定数量',
field: 'lockedQuantity',
sort: 'custom',
table: {
width: 150,
},
isSearch: true,
form: {
component: 'InputNumber',
value: 0
}
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// isSearch: true,
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE'
// }
// }
// },
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 150
},
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: '创建人',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: true,
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 150,
// fixed: 'right'
// }
// }
]))
Loading…
Cancel
Save