Browse Source

器具管理模块

hella_online_20241107
yufei_wang 4 weeks ago
parent
commit
ccd9351923
  1. 1
      src/views/wms/inventoryjobManage/containermanage/createContainerRecordMain/createContainerRecordMain.data.ts
  2. 119
      src/views/wms/inventoryjobManage/containermanage/createContainerRecordMain/index.vue
  3. 150
      src/views/wms/inventoryjobManage/containermanage/moveContainerRecordMain/index.vue
  4. 10
      src/views/wms/inventoryjobManage/containermanage/moveContainerRecordMain/moveContainerRecordMain.data.ts
  5. 152
      src/views/wms/inventoryjobManage/containermanage/returnContainerRecordMain/index.vue
  6. 10
      src/views/wms/inventoryjobManage/containermanage/returnContainerRecordMain/returnContainerRecordMain.data.ts
  7. 155
      src/views/wms/inventoryjobManage/containermanage/scrapContainerRecordMain/index.vue
  8. 10
      src/views/wms/inventoryjobManage/containermanage/scrapContainerRecordMain/scrapContainerRecordMain.data.ts

1
src/views/wms/inventoryjobManage/containermanage/createContainerRecordMain/createContainerRecordMain.data.ts

@ -39,7 +39,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE, dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120

119
src/views/wms/inventoryjobManage/containermanage/createContainerRecordMain/index.vue

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> <Search
:schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -12,7 +16,7 @@
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ContainerRecordMain.allSchemas" :allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetailAllSchemas" :detailAllSchemas="ContainerRecordDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -33,23 +37,8 @@
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerRecordMainRules"
:formAllSchemas="ContainerRecordMain.allSchemas"
:tableAllSchemas="ContainerRecordDetail.allSchemas"
:tableFormRules="ContainerRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -80,45 +69,22 @@ import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { json } from 'stream/consumers' import { json } from 'stream/consumers'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'ContainerRecordMain' }) defineOptions({ name: 'createContainerRecordMain' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const businessType = ref()
const importFileName = ref() const importFileName = ref()
const tableColumns = ref([...ContainerRecordMain.allSchemas.tableColumns, ...ContainerRecordDetail.allSchemas.tableMainColumns]) const tableColumns =
// const ContainerRecordDetailTableColumns = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))) ref([ ...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns])
const ContainerRecordDetailAllSchemas = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas)))
console.log(2233,ContainerRecordDetail.allSchemas.tableMainColumns)
const searchType = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage // getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage //
}) })
tableObject.params = {
// type:'CREATE'
/** }
* importFileName.value = '器具新增记录'
*/
// if ( routeName.value == 'InitialContainerManageRecord') {
// tableObject.params = {
// type:'INITIAL',
// }
// searchType.value = 'INITIAL'
// businessType.value = 'InitialContainerManage'
// importFileName.value = ''
// }
// if ( routeName.value == 'InitialContainerManageRecord') {
// const array = ContainerRecordDetail.allSchemas.tableMainColumns.filter(item=>item.field != "fromLocationCode")
// ContainerRecordDetailAllSchemas.value.tableMainColumns = array
// tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetailAllSchemas.value.tableMainColumns]
// }
// else {
// ContainerRecordDetail.allSchemas.tableMainColumns =JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))
// tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns]
// }
// //
@ -135,26 +101,11 @@ const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
const searchList = (model)=>{
model.type = searchType.value
setSearchParams(model)
}
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'export') { //
openForm('create')
} else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
@ -169,28 +120,6 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:`wms:{routeName.value}:update`}), //
// defaultButtons.mainListDeleteBtn({hasPermi:`wms:{routeName.value}:delete`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
@ -201,24 +130,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain") detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain")
} }
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRecordMainApi.deleteContainerRecordMain(id)
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
@ -241,7 +154,7 @@ const searchFormClick = (searchData) => {
const cmd = { const cmd = {
'column':'type', 'column':'type',
'action':'==', 'action':'==',
'value': 'CREATE' 'value':'CREATE'
} }
if (!Array.isArray(searchData.filters)) { if (!Array.isArray(searchData.filters)) {
searchData.filters = []; searchData.filters = [];

150
src/views/wms/inventoryjobManage/containermanage/moveContainerRecordMain/index.vue

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> <Search
:schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -12,7 +16,7 @@
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ContainerRecordMain.allSchemas" :allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetailAllSchemas" :detailAllSchemas="ContainerRecordDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -33,23 +37,8 @@
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerRecordMainRules"
:formAllSchemas="ContainerRecordMain.allSchemas"
:tableAllSchemas="ContainerRecordDetail.allSchemas"
:tableFormRules="ContainerRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -86,71 +75,16 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const businessType = ref()
const importFileName = ref() const importFileName = ref()
const tableColumns = ref([...ContainerRecordMain.allSchemas.tableColumns, ...ContainerRecordDetail.allSchemas.tableMainColumns]) const tableColumns =
// const ContainerRecordDetailTableColumns = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))) ref([ ...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns])
const ContainerRecordDetailAllSchemas = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas)))
console.log(2233,ContainerRecordDetail.allSchemas.tableMainColumns)
const searchType = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage // getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage //
}) })
tableObject.params = {
//
/**
*
*/
if ( routeName.value == 'ReturnContainerManageRecord') {
tableObject.params = {
type:'RETURN'
}
searchType.value = 'RETURN'
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回记录'
} else if ( routeName.value == 'MoveContainerManageRecord') {
tableObject.params = {
type:'MOVE' type:'MOVE'
}
searchType.value = 'MOVE'
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移记录'
} else if ( routeName.value == 'InitialContainerManageRecord') {
tableObject.params = {
type:'INITIAL',
}
searchType.value = 'INITIAL'
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化记录'
}
else if ( routeName.value == 'ScrapContainerManageRecord') {
tableObject.params = {
type:'SCRAP'
}
searchType.value = 'SCRAP'
businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废记录'
} else if ( routeName.value == 'DeliverContainerManageRecord') {
tableObject.params = {
type: 'DELIVER',
}
searchType.value = 'DELIVER'
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具发运记录'
} else if( routeName.value == 'ContainerManageRecord'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理记录'
} }
if ( routeName.value == 'InitialContainerManageRecord') { importFileName.value = '器具移动记录'
const array = ContainerRecordDetail.allSchemas.tableMainColumns.filter(item=>item.field != "fromLocationCode")
ContainerRecordDetailAllSchemas.value.tableMainColumns = array
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetailAllSchemas.value.tableMainColumns]
}
else {
ContainerRecordDetail.allSchemas.tableMainColumns =JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns]
}
// //
@ -167,26 +101,11 @@ const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
const searchList = (model)=>{
model.type = searchType.value
setSearchParams(model)
}
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'export') { //
openForm('create')
} else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
@ -201,28 +120,6 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:`wms:{routeName.value}:update`}), //
// defaultButtons.mainListDeleteBtn({hasPermi:`wms:{routeName.value}:delete`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
@ -233,24 +130,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain") detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain")
} }
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRecordMainApi.deleteContainerRecordMain(id)
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
@ -260,13 +141,8 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if(businessType.value = 'InitialContainerManage'){
const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params) const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else {
const data = await ContainerRecordMainApi.exportContainerRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch { } catch {
} finally { } finally {
loadDone() loadDone()
@ -278,7 +154,7 @@ const searchFormClick = (searchData) => {
const cmd = { const cmd = {
'column':'type', 'column':'type',
'action':'==', 'action':'==',
'value':searchType.value 'value':'MOVE'
} }
if (!Array.isArray(searchData.filters)) { if (!Array.isArray(searchData.filters)) {
searchData.filters = []; searchData.filters = [];

10
src/views/wms/inventoryjobManage/containermanage/moveContainerRecordMain/moveContainerRecordMain.data.ts

@ -39,7 +39,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE, dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
@ -180,15 +179,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
} }
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
} }
])) ]))

152
src/views/wms/inventoryjobManage/containermanage/returnContainerRecordMain/index.vue

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> <Search
:schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -12,7 +16,7 @@
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ContainerRecordMain.allSchemas" :allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetailAllSchemas" :detailAllSchemas="ContainerRecordDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -33,23 +37,8 @@
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerRecordMainRules"
:formAllSchemas="ContainerRecordMain.allSchemas"
:tableAllSchemas="ContainerRecordDetail.allSchemas"
:tableFormRules="ContainerRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -67,7 +56,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ContainerRecordMain, ContainerRecordMainRules, ContainerRecordDetail, ContainerRecordDetailRules } from './moveContainerRecordMain.data' import { ContainerRecordMain, ContainerRecordMainRules, ContainerRecordDetail, ContainerRecordDetailRules } from './returnContainerRecordMain.data'
console.log(3444,ContainerRecordDetail) console.log(3444,ContainerRecordDetail)
import * as ContainerRecordMainApi from '@/api/wms/containerRecordMain' import * as ContainerRecordMainApi from '@/api/wms/containerRecordMain'
@ -86,71 +75,16 @@ const { t } = useI18n() // 国际化
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const businessType = ref()
const importFileName = ref() const importFileName = ref()
const tableColumns = ref([...ContainerRecordMain.allSchemas.tableColumns, ...ContainerRecordDetail.allSchemas.tableMainColumns]) const tableColumns =
// const ContainerRecordDetailTableColumns = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))) ref([ ...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns])
const ContainerRecordDetailAllSchemas = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas)))
console.log(2233,ContainerRecordDetail.allSchemas.tableMainColumns)
const searchType = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage // getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage //
}) })
tableObject.params = {
//
/**
*
*/
if ( routeName.value == 'ReturnContainerManageRecord') {
tableObject.params = {
type:'RETURN' type:'RETURN'
}
searchType.value = 'RETURN'
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回记录'
} else if ( routeName.value == 'MoveContainerManageRecord') {
tableObject.params = {
type:'MOVE'
}
searchType.value = 'MOVE'
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移记录'
} else if ( routeName.value == 'InitialContainerManageRecord') {
tableObject.params = {
type:'INITIAL',
}
searchType.value = 'INITIAL'
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化记录'
}
else if ( routeName.value == 'ScrapContainerManageRecord') {
tableObject.params = {
type:'SCRAP'
}
searchType.value = 'SCRAP'
businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废记录'
} else if ( routeName.value == 'DeliverContainerManageRecord') {
tableObject.params = {
type: 'DELIVER',
}
searchType.value = 'DELIVER'
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具发运记录'
} else if( routeName.value == 'ContainerManageRecord'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理记录'
} }
if ( routeName.value == 'InitialContainerManageRecord') { importFileName.value = '器具返回记录'
const array = ContainerRecordDetail.allSchemas.tableMainColumns.filter(item=>item.field != "fromLocationCode")
ContainerRecordDetailAllSchemas.value.tableMainColumns = array
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetailAllSchemas.value.tableMainColumns]
}
else {
ContainerRecordDetail.allSchemas.tableMainColumns =JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns]
}
// //
@ -167,26 +101,11 @@ const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
const searchList = (model)=>{
model.type = searchType.value
setSearchParams(model)
}
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'export') { //
openForm('create')
} else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
@ -201,28 +120,6 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:`wms:{routeName.value}:update`}), //
// defaultButtons.mainListDeleteBtn({hasPermi:`wms:{routeName.value}:delete`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
@ -233,24 +130,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain") detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain")
} }
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRecordMainApi.deleteContainerRecordMain(id)
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
@ -260,13 +141,8 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if(businessType.value = 'InitialContainerManage'){
const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params) const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else {
const data = await ContainerRecordMainApi.exportContainerRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch { } catch {
} finally { } finally {
loadDone() loadDone()
@ -278,7 +154,7 @@ const searchFormClick = (searchData) => {
const cmd = { const cmd = {
'column':'type', 'column':'type',
'action':'==', 'action':'==',
'value':searchType.value 'value':'RETURN'
} }
if (!Array.isArray(searchData.filters)) { if (!Array.isArray(searchData.filters)) {
searchData.filters = []; searchData.filters = [];

10
src/views/wms/inventoryjobManage/containermanage/returnContainerRecordMain/moveContainerRecordMain.data.ts → src/views/wms/inventoryjobManage/containermanage/returnContainerRecordMain/returnContainerRecordMain.data.ts

@ -39,7 +39,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE, dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
@ -180,15 +179,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
} }
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
} }
])) ]))

155
src/views/wms/inventoryjobManage/containermanage/scrapContainerRecordMain/index.vue

@ -1,7 +1,11 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<Search :schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]" @search="searchList" @reset="searchList" /> <Search
:schema="[...ContainerRecordMain.allSchemas.searchSchema,...ContainerRecordDetail.allSchemas.searchSchema]"
@search="setSearchParams"
@reset="setSearchParams"
/>
</ContentWrap> </ContentWrap>
<!-- 列表头部 --> <!-- 列表头部 -->
@ -12,7 +16,7 @@
@updataTableColumns="updataTableColumns" @updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick" @searchFormClick="searchFormClick"
:allSchemas="ContainerRecordMain.allSchemas" :allSchemas="ContainerRecordMain.allSchemas"
:detailAllSchemas="ContainerRecordDetailAllSchemas" :detailAllSchemas="ContainerRecordDetail.allSchemas"
/> />
<!-- 列表 --> <!-- 列表 -->
@ -33,23 +37,8 @@
<span>{{ row.number }}</span> <span>{{ row.number }}</span>
</el-button> </el-button>
</template> </template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table> </Table>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="ContainerRecordMainRules"
:formAllSchemas="ContainerRecordMain.allSchemas"
:tableAllSchemas="ContainerRecordDetail.allSchemas"
:tableFormRules="ContainerRecordDetailRules"
:isBusiness="true"
/>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -67,7 +56,7 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { ContainerRecordMain, ContainerRecordMainRules, ContainerRecordDetail, ContainerRecordDetailRules } from './initialContainerRecordMain.data' import { ContainerRecordMain, ContainerRecordMainRules, ContainerRecordDetail, ContainerRecordDetailRules } from './scrapContainerRecordMain.data'
console.log(3444,ContainerRecordDetail) console.log(3444,ContainerRecordDetail)
import * as ContainerRecordMainApi from '@/api/wms/containerRecordMain' import * as ContainerRecordMainApi from '@/api/wms/containerRecordMain'
@ -80,77 +69,22 @@ import { formatDate } from '@/utils/formatTime'
import { usePageLoading } from '@/hooks/web/usePageLoading' import { usePageLoading } from '@/hooks/web/usePageLoading'
import { json } from 'stream/consumers' import { json } from 'stream/consumers'
const { loadStart, loadDone } = usePageLoading() const { loadStart, loadDone } = usePageLoading()
defineOptions({ name: 'ContainerRecordMain' }) defineOptions({ name: 'ScrapContainerManageRecord' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
routeName.value = route.name routeName.value = route.name
const businessType = ref()
const importFileName = ref() const importFileName = ref()
const tableColumns = ref([...ContainerRecordMain.allSchemas.tableColumns, ...ContainerRecordDetail.allSchemas.tableMainColumns]) const tableColumns =
// const ContainerRecordDetailTableColumns = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))) ref([ ...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns])
const ContainerRecordDetailAllSchemas = ref(JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas)))
console.log(2233,ContainerRecordDetail.allSchemas.tableMainColumns)
const searchType = ref()
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage // getListApi: ContainerRecordDetailApi.getContainerRecordDetailPage //
}) })
tableObject.params = {
//
/**
*
*/
if ( routeName.value == 'ReturnContainerManageRecord') {
tableObject.params = {
type:'RETURN'
}
searchType.value = 'RETURN'
businessType.value = 'ReturnContainerManage'
importFileName.value = '器具返回记录'
} else if ( routeName.value == 'MoveContainerManageRecord') {
tableObject.params = {
type:'MOVE'
}
searchType.value = 'MOVE'
businessType.value = 'MoveContainerManage'
importFileName.value = '器具转移记录'
} else if ( routeName.value == 'InitialContainerManageRecord') {
tableObject.params = {
type:'INITIAL',
}
searchType.value = 'INITIAL'
businessType.value = 'InitialContainerManage'
importFileName.value = '器具初始化记录'
}
else if ( routeName.value == 'ScrapContainerManageRecord') {
tableObject.params = {
type:'SCRAP' type:'SCRAP'
}
searchType.value = 'SCRAP'
businessType.value = 'ScrapContainerManage'
importFileName.value = '器具报废记录'
} else if ( routeName.value == 'DeliverContainerManageRecord') {
tableObject.params = {
type: 'DELIVER',
}
searchType.value = 'DELIVER'
businessType.value = 'DeliverContainerManage'
importFileName.value = '器具发运记录'
} else if( routeName.value == 'ContainerManageRecord'){
businessType.value = 'ContainerManage'
importFileName.value = '器具管理记录'
} }
if ( routeName.value == 'InitialContainerManageRecord') { importFileName.value = '器具报废记录'
const array = ContainerRecordDetail.allSchemas.tableMainColumns.filter(item=>item.field != "fromLocationCode")
ContainerRecordDetailAllSchemas.value.tableMainColumns = array
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetailAllSchemas.value.tableMainColumns]
}
else {
ContainerRecordDetail.allSchemas.tableMainColumns =JSON.parse(JSON.stringify(ContainerRecordDetail.allSchemas.tableMainColumns))
tableColumns.value = [...ContainerRecordMain.allSchemas.tableColumns,...ContainerRecordDetail.allSchemas.tableMainColumns]
}
// //
@ -162,31 +96,15 @@ const updataTableColumns = (val) => {
const { getList, setSearchParams } = tableMethods const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:`wms:{routeName.value}:create`}), //
defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export`}), // defaultButtons.defaultExportBtn({hasPermi:`wms:${routeName.value}:export`}), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
const searchList = (model)=>{
model.type = searchType.value
setSearchParams(model)
}
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'export') { //
openForm('create')
} else if (val == 'export') { //
handleExport() handleExport()
} else if (val == 'refresh') { // } else if (val == 'refresh') { //
if (tableObject.params.filters && tableObject.params.filters.length > 0 ) { if (tableObject.params.filters && tableObject.params.filters.length > 0 ) {
@ -201,28 +119,6 @@ const buttonBaseClick = (val, item) => {
console.log('其他按钮', item) console.log('其他按钮', item)
} }
} }
// -
const butttondata = (row,$index) => {
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1
if(findIndex>-1&&findIndex<$index){
return []
}
return [
// defaultButtons.mainListEditBtn({hasPermi:`wms:{routeName.value}:update`}), //
// defaultButtons.mainListDeleteBtn({hasPermi:`wms:{routeName.value}:delete`}), //
]
}
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
// //
const { wsCache } = useCache() const { wsCache } = useCache()
/** 详情操作 */ /** 详情操作 */
@ -233,24 +129,8 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain") detailRef.value.openDetail(row, titleName, titleValue,"recordContainerMain")
} }
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRecordMainApi.deleteContainerRecordMain(id)
message.success(t('common.delSuccess'))
//
buttonBaseClick('refresh',null)
} catch {}
}
/** 导出按钮操作 */ /** 导出按钮操作 */
const handleExport = async () => { const handleExport = async () => {
@ -260,13 +140,8 @@ const handleExport = async () => {
// //
loadStart() loadStart()
const excelTitle = ref(route.meta.title) const excelTitle = ref(route.meta.title)
if(businessType.value = 'InitialContainerManage'){
const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params) const data = await ContainerRecordMainApi.exportContainerInitRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`) download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}else {
const data = await ContainerRecordMainApi.exportContainerRecordMain(tableObject.params)
download.excel(data, `${excelTitle.value}】【${formatDate(new Date())}】.xlsx`)
}
} catch { } catch {
} finally { } finally {
loadDone() loadDone()
@ -278,7 +153,7 @@ const searchFormClick = (searchData) => {
const cmd = { const cmd = {
'column':'type', 'column':'type',
'action':'==', 'action':'==',
'value':searchType.value 'value':'SCRAP'
} }
if (!Array.isArray(searchData.filters)) { if (!Array.isArray(searchData.filters)) {
searchData.filters = []; searchData.filters = [];

10
src/views/wms/inventoryjobManage/containermanage/scrapContainerRecordMain/scrapContainerRecordMain.data.ts

@ -39,7 +39,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE, dictType: DICT_TYPE.CONTAIN_MANAGE_TYPE,
dictClass: 'string', dictClass: 'string',
isSearch: true,
isTable: true, isTable: true,
table: { table: {
width: 120 width: 120
@ -180,15 +179,6 @@ export const ContainerRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
} }
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
} }
])) ]))

Loading…
Cancel
Save