陈薪名 11 months ago
parent
commit
3128a04876
  1. 57
      src/api/wms/containerBindRecordDetail/index.ts
  2. 69
      src/api/wms/containerBindRecordMain/index.ts
  3. 165
      src/views/wms/inventoryManage/containerinit/containerBindRecord/containerBindRecordMain.data.ts
  4. 286
      src/views/wms/inventoryManage/containerinit/containerBindRecord/index.vue
  5. 51
      src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts
  6. 23
      src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue
  7. 1
      src/views/wms/inventoryManage/containerinit/containerinitrecord/index.vue

57
src/api/wms/containerBindRecordDetail/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface ContainerBindRecordDetailVO {
id: number
containerContentType: string
contentNumber: string
itemCode: string
batch: string
inventoryStatus: string
uom: string
qty: number
masterId: number
number: string
siteId: string
remark: string
}
// 查询器具绑定记录子列表
export const getContainerBindRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-bind-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/container-bind-record-detail/page`, params })
}
}
// 查询器具绑定记录子详情
export const getContainerBindRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/container-bind-record-detail/get?id=` + id })
}
// 新增器具绑定记录子
export const createContainerBindRecordDetail = async (data: ContainerBindRecordDetailVO) => {
return await request.post({ url: `/wms/container-bind-record-detail/create`, data })
}
// 修改器具绑定记录子
export const updateContainerBindRecordDetail = async (data: ContainerBindRecordDetailVO) => {
return await request.put({ url: `/wms/container-bind-record-detail/update`, data })
}
// 删除器具绑定记录子
export const deleteContainerBindRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/container-bind-record-detail/delete?id=` + id })
}
// 导出器具绑定记录子 Excel
export const exportContainerBindRecordDetail = async (params) => {
return await request.download({ url: `/wms/container-bind-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-bind-record-detail/get-import-template' })
}

69
src/api/wms/containerBindRecordMain/index.ts

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface ContainerBindRecordMainVO {
id: number
number: string
containerNumber: string
fromWarehouseCode: string
toWarehouseCode: string
outTransactionType: string
inTransactionType: string
executeTime: Date
activeDate: Date
available: string
requestTime: Date
dueTime: Date
departmentCode: string
userGroupCode: string
interfaceType: string
businessType: string
remark: string
extraProperties: string
siteId: string
code: string
fromLocationTypes: string
toLocationTypes: string
fromAreaCodes: string
toAreaCodes: string
}
// 查询器具绑定记录主列表
export const getContainerBindRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-bind-record-main/senior', data })
} else {
return await request.get({ url: `/wms/container-bind-record-main/page`, params })
}
}
// 查询器具绑定记录主详情
export const getContainerBindRecordMain = async (id: number) => {
return await request.get({ url: `/wms/container-bind-record-main/get?id=` + id })
}
// 新增器具绑定记录主
export const createContainerBindRecordMain = async (data: ContainerBindRecordMainVO) => {
return await request.post({ url: `/wms/container-bind-record-main/create`, data })
}
// 修改器具绑定记录主
export const updateContainerBindRecordMain = async (data: ContainerBindRecordMainVO) => {
return await request.put({ url: `/wms/container-bind-record-main/update`, data })
}
// 删除器具绑定记录主
export const deleteContainerBindRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/container-bind-record-main/delete?id=` + id })
}
// 导出器具绑定记录主 Excel
export const exportContainerBindRecordMain = async (params) => {
return await request.download({ url: `/wms/container-bind-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-bind-record-main/get-import-template' })
}

165
src/views/wms/inventoryManage/containerinit/containerBindRecord/containerBindRecordMain.data.ts

@ -0,0 +1,165 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ContainerBindRecordMainRules = reactive({
})
export const ContainerBindRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
isSearch: true,
},
{
label: '仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerBindRecordDetailRules = reactive({
})
export const ContainerBindRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
},
},
{
label: '内容物类型',
field: 'containerContentType',
sort: 'custom',
isSearch: true,
form: {
component: 'SelectV2'
},
table: {
width: 150
}
},
{
label: '内容物号',
field: 'contentNumber',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '库存状态',
field: 'inventoryStatus',
sort: 'custom',
form: {
component: 'Radio'
},
table: {
width: 150
}
},
{
label: '计量单位',
field: 'uom',
sort: 'custom',
table: {
width: 150
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
table: {
width: 150
},
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: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

286
src/views/wms/inventoryManage/containerinit/containerBindRecord/index.vue

@ -0,0 +1,286 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ContainerBindRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerBindRecordMain.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 #number="{row}">
<el-button type="primary" link @click="openDetail(row, '单据号', row.number)">
<span>{{ row.number }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerBindRecordMainRules"
:formAllSchemas="ContainerBindRecordMain.allSchemas"
:searchTableParams="searchTableParams"
:tableAllSchemas="ContainerBindRecordDetail.allSchemas"
:tableFormRules="ContainerBindRecordDetailRules"
:tableData="tableData"
:apiUpdate="ContainerBindRecordMainApi.updateContainerBindRecordMain"
:apiCreate="ContainerBindRecordMainApi.createContainerBindRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerBindRecordMain.allSchemas"
:detailAllSchemas="ContainerBindRecordDetail.allSchemas"
:detail-all-schemas-rules="ContainerBindRecordDetailRules"
:searchTableParams="searchTableParams"
:apiCreate="ContainerBindRecordDetailApi.createContainerBindRecordDetail"
:apiUpdate="ContainerBindRecordDetailApi.updateContainerBindRecordDetail"
:apiPage="ContainerBindRecordDetailApi.getContainerBindRecordDetailPage"
:apiDelete="ContainerBindRecordDetailApi.deleteContainerBindRecordDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-bind-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerBindRecordMain,ContainerBindRecordMainRules,ContainerBindRecordDetail,ContainerBindRecordDetailRules } from './containerBindRecordMain.data'
import * as ContainerBindRecordMainApi from '@/api/wms/containerBindRecordMain'
import * as ContainerBindRecordDetailApi from '@/api/wms/containerBindRecordDetail'
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: 'ContainerBindRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ContainerBindRecordMain.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: ContainerBindRecordMainApi.getContainerBindRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:container-bind-record-main:create'}), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:container-bind-record-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-bind-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:container-bind-record-detail:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-bind-record-detail: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)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicContainerBindRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerBindRecordMainApi.deleteContainerBindRecordMain(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 ContainerBindRecordMainApi.exportContainerBindRecordMain(setSearchParams)
download.excel(data, '器具绑定记录主.xls')
} catch {
} finally {
exportLoading.value = false
}
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await ContainerBindRecordMainApi.createContainerBindRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ContainerBindRecordMainApi.updateContainerBindRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
const tableData = ref([])
const tableFormKeys = {}
ContainerBindRecordDetail.allSchemas.tableFormColumns.forEach(item => {
tableFormKeys[item.field] = item.default ? item.default : ''
})
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '器具绑定记录主导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await ContainerBindRecordMainApi.importTemplate()
})
</script>

51
src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts

@ -3,6 +3,8 @@ import {Owner} from "@/views/wms/basicDataManage/orderManage/owner/owner.data";
import * as OwnerApi from "@/api/wms/owner"; import * as OwnerApi from "@/api/wms/owner";
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data"; import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse"; import * as WarehouseApi from "@/api/wms/warehouse";
import {Balance} from "@/views/wms/inventoryManage/balance/balance.data";
import * as BalanceApi from "@/api/wms/balance";
// 表单校验 // 表单校验
export const ContainerMainRules = reactive({ export const ContainerMainRules = reactive({
@ -47,8 +49,8 @@ export const ContainerMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
}, },
{ {
label: '状态', label: '器具状态',
field: 'status', field: 'containerStatus',
dictType: DICT_TYPE.CONTAINER_STATUS, dictType: DICT_TYPE.CONTAINER_STATUS,
dictClass: 'string', dictClass: 'string',
isTable: true, isTable: true,
@ -157,6 +159,40 @@ export const ContainerDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
tableForm:{
disabled:true,
isInpuFocusShow: true,
earchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'workshopCode',
value: 'workshopCode',
isMainValue: true
}]
},
form:{
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装号',
searchField: 'packingNumber',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalancePage,
searchCondition: [{
key: 'warehouseCode',
value: 'fromWarehouseCode',
isMainValue: true,
}]
}
}
}, },
{ {
label: '物料代码', label: '物料代码',
@ -209,6 +245,17 @@ export const ContainerDetail = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
}, },
}, },
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
},
isTableForm:false,
}
])) ]))
// 表单校验 // 表单校验

23
src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue

@ -57,7 +57,12 @@
:allSchemas="ContainerMain.allSchemas" :allSchemas="ContainerMain.allSchemas"
:detailAllSchemas="ContainerDetail.allSchemas" :detailAllSchemas="ContainerDetail.allSchemas"
:detailAllSchemasRules="ContainerDetailRules" :detailAllSchemasRules="ContainerDetailRules"
:searchTableParams="searchTableParams"
:apiPage="ContainerDetailApi.getContainerDetailPage" :apiPage="ContainerDetailApi.getContainerDetailPage"
:apiCreate="ContainerDetailApi.createContainerDetail"
:apiUpdate="ContainerDetailApi.updateContainerDetail"
:apiDelete="ContainerDetailApi.deleteContainerDetail"
@searchTableSuccessDetail="searchTableSuccessDetail"
/> />
</template> </template>
@ -167,6 +172,24 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
if(formField == 'contentNumber'){
setV['contentNumber'] = val[0]['packingNumber']
setV['batch'] = val[0]['batch']
setV['inventoryStatus'] = val[0]['inventoryStatus']
setV['qty'] = val[0]['qty']
setV['uom'] = val[0]['uom']
setV['itemCode'] = val[0]['itemCode']
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
})
}
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {

1
src/views/wms/inventoryManage/containerinit/containerinitrecord/index.vue

@ -69,7 +69,6 @@
:apiUpdate="ContainerInitRecordDetailApi.updateContainerInitRecordDetail" :apiUpdate="ContainerInitRecordDetailApi.updateContainerInitRecordDetail"
:apiPage="ContainerInitRecordDetailApi.getContainerInitRecordDetailPage" :apiPage="ContainerInitRecordDetailApi.getContainerInitRecordDetailPage"
:apiDelete="ContainerInitRecordDetailApi.deleteContainerInitRecordDetail" :apiDelete="ContainerInitRecordDetailApi.deleteContainerInitRecordDetail"
:Echo="Echo"
/> />
<!-- 导入 --> <!-- 导入 -->

Loading…
Cancel
Save