Browse Source

物料降级api更新

master_hella_20240701
chenfang 6 months ago
parent
commit
e27b2b4db9
  1. 74
      src/api/wms/relegateRecordDetail/index.ts
  2. 61
      src/api/wms/relegateRecordMain/index.ts
  3. 30
      src/api/wms/relegateRequestMain/index.ts
  4. 244
      src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/index.vue
  5. 204
      src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts
  6. 6
      src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue
  7. 2
      src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue

74
src/api/wms/relegateRecordDetail/index.ts

@ -0,0 +1,74 @@
import request from '@/config/axios'
export interface RelegateRecordDetailVO {
id: number
masterId: number
itemCode: string
downItemCode: string
businessType: string
uom: string
qty: number
inventoryStatus: string
fromBatch: string
fromPackingNumber: string
fromLocationCode: string
fromAreaTypes: string
fromAreaCodes: string
toPackingNumber: string
toBatch: string
toLocationCode: string
toWarehouseCode: string
toAreaTypes: string
toAreaCodes: string
number: string
available: string
remark: string
departmentCode: string
siteId: number
extraProperties: string
status: string
concurrencyStamp: number
serialNumber: string
ruleUserId: number
}
// 查询物料降级记录子列表
export const getRelegateRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/relegate-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/relegate-record-detail/page`, params })
}
}
// 查询物料降级记录子详情
export const getRelegateRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/relegate-record-detail/get?id=` + id })
}
// 新增物料降级记录子
export const createRelegateRecordDetail = async (data: RelegateRecordDetailVO) => {
return await request.post({ url: `/wms/relegate-record-detail/create`, data })
}
// 修改物料降级记录子
export const updateRelegateRecordDetail = async (data: RelegateRecordDetailVO) => {
return await request.put({ url: `/wms/relegate-record-detail/update`, data })
}
// 删除物料降级记录子
export const deleteRelegateRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/relegate-record-detail/delete?id=` + id })
}
// 导出物料降级记录子 Excel
export const exportRelegateRecordDetail = async (params) => {
return await request.download({ url: `/wms/relegate-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/relegate-record-detail/get-import-template' })
}

61
src/api/wms/relegateRecordMain/index.ts

@ -0,0 +1,61 @@
import request from '@/config/axios'
export interface RelegateRecordMainVO {
id: number
requestNumber: string
executeTime: Date
activeDate: Date
available: string
requestTime: Date
dueTime: Date
departmentCode: string
userGroupCode: string
interfaceType: string
code: string
number: string
businessType: string
remark: string
extraProperties: string
siteId: string
}
// 查询物料降级记录主列表
export const getRelegateRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/relegate-record-main/senior', data })
} else {
return await request.get({ url: `/wms/relegate-record-main/page`, params })
}
}
// 查询物料降级记录主详情
export const getRelegateRecordMain = async (id: number) => {
return await request.get({ url: `/wms/relegate-record-main/get?id=` + id })
}
// 新增物料降级记录主
export const createRelegateRecordMain = async (data: RelegateRecordMainVO) => {
return await request.post({ url: `/wms/relegate-record-main/create`, data })
}
// 修改物料降级记录主
export const updateRelegateRecordMain = async (data: RelegateRecordMainVO) => {
return await request.put({ url: `/wms/relegate-record-main/update`, data })
}
// 删除物料降级记录主
export const deleteRelegateRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/relegate-record-main/delete?id=` + id })
}
// 导出物料降级记录主 Excel
export const exportRelegateRecordMain = async (params) => {
return await request.download({ url: `/wms/relegate-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/relegate-record-main/get-import-template' })
}

30
src/api/wms/relegateRequestMain/index.ts

@ -65,4 +65,34 @@ export const exportRelegateRequestMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/wms/relegate-request-main/get-import-template' }) return request.download({ url: '/wms/relegate-request-main/get-import-template' })
}
// 关闭
export const close = (id) => {
return request.put({ url: '/wms/relegate-request-main/close?id=' + id })
}
// 重新添加
export const reAdd = (id) => {
return request.put({ url: '/wms/relegate-request-main/reAdd?id=' + id })
}
// 提交审批
export const submit = (id) => {
return request.put({ url: '/wms/relegate-request-main/submit?id=' + id })
}
// 驳回
export const refused = (id) => {
return request.put({ url: '/wms/relegate-request-main/refused?id=' + id })
}
// 审批通过
export const agree = (id) => {
return request.put({ url: '/wms/relegate-request-main/agree?id=' + id })
}
// 处理
export const handle = (id) => {
return request.put({ url: '/wms/relegate-request-main/handle?id=' + id })
} }

244
src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/index.vue

@ -0,0 +1,244 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="RelegateRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="RelegateRecordMain.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="RelegateRecordMainRules"
:formAllSchemas="RelegateRecordMain.allSchemas"
:apiUpdate="RelegateRecordMainApi.updateRelegateRecordMain"
:apiCreate="RelegateRecordMainApi.createRelegateRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="RelegateRecordMain.allSchemas" />
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/relegate-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { RelegateRecordMain,RelegateRecordMainRules } from './relegate-record-main.data'
import * as RelegateRecordMainApi from '@/api/wms/relegateRecordMain'
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: 'RelegateRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(RelegateRecordMain.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: RelegateRecordMainApi.getRelegateRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'wms:relegate-record-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:relegate-record-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:relegate-record-main: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:relegate-record-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:relegate-record-main: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 =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') {
await RelegateRecordMainApi.createRelegateRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await RelegateRecordMainApi.updateRelegateRecordMain(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, 'basicRelegateRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await RelegateRecordMainApi.deleteRelegateRecordMain(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 RelegateRecordMainApi.exportRelegateRecordMain(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 RelegateRecordMainApi.importTemplate()
})
</script>

204
src/views/wms/basicDataManage/itemManage/relegate/relegateRecord/relegateRecordMain.data.ts

@ -0,0 +1,204 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const RelegateRecordMainRules = reactive({
departmentCode: [required],
interfaceType: [required],
number: [required],
businessType: [required],
})
export const RelegateRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
},
{
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
},
{
label: '执行时间',
field: 'executeTime',
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: 'activeDate',
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: 'available',
sort: 'custom',
isSearch: true,
},
{
label: '申请时间',
field: 'requestTime',
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: 'dueTime',
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: 'departmentCode',
sort: 'custom',
isSearch: true,
},
{
label: '用户组',
field: 'userGroupCode',
sort: 'custom',
isSearch: true,
},
{
label: '接口类型',
field: 'interfaceType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
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: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: true,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

6
src/views/wms/basicDataManage/itemManage/relegate/relegateRequest/index.vue

@ -239,6 +239,12 @@ const butttondata = (row, $index) => {
return [] return []
} }
return [ return [
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['2','3','4','6']),hasPermi:'wms:relegate-request-main:close'}), //
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:relegate-request-main:reAdd'}), //
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:relegate-request-main:submit'}), //
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:relegate-request-main:refused'}), //
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:relegate-request-main:agree'}), //
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:relegate-request-main:handle'}), //
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:relegate-request-main:update' }), // defaultButtons.mainListEditBtn({ hide: isShowMainButton(row, ['1']), hasPermi: 'wms:relegate-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:relegate-request-main:delete' }), // defaultButtons.mainListDeleteBtn({ hasPermi: 'wms:relegate-request-main:delete' }), //
] ]

2
src/views/wms/inventoryjobManage/containermanage/containerMainRequest/index.vue

@ -29,7 +29,7 @@
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #number="{row}"> <template #number="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.number)"> <el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>

Loading…
Cancel
Save