陈薪名 11 months ago
parent
commit
bcb5e8a5e3
  1. 10
      src/api/wms/containerMain/index.ts
  2. 53
      src/api/wms/containerRepairRecordDetail/index.ts
  3. 69
      src/api/wms/containerRepairRecordMain/index.ts
  4. 8
      src/views/wms/inventoryManage/container/containerMain.data.ts
  5. 135
      src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts
  6. 285
      src/views/wms/inventoryManage/containerinit/containerRepair/index.vue
  7. 10
      src/views/wms/inventoryManage/containerinit/containerinitadd/containerMain.data.ts
  8. 46
      src/views/wms/inventoryManage/containerinit/containerinitadd/index.vue

10
src/api/wms/containerMain/index.ts

@ -49,3 +49,13 @@ export const exportContainerMain = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/container-main/get-import-template' })
}
// 器具维修
export const repairSubmitContainerRequestMain = async (id) => {
return await request.put({ url: `/wms/container-main/repair?id=` + id })
}
// 器具报废
export const scrapSubmitContainerRequestMain = async (id) => {
return await request.put({ url: `/wms/container-main/scrap?id=` + id })
}

53
src/api/wms/containerRepairRecordDetail/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
export interface ContainerRepairRecordDetailVO {
id: number
containerNumber: string
fromContainerStatus: string
toContainerStatus: string
masterId: number
number: string
siteId: string
remark: string
}
// 查询器具维修记录子列表
export const getContainerRepairRecordDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-repair-record-detail/senior', data })
} else {
return await request.get({ url: `/wms/container-repair-record-detail/page`, params })
}
}
// 查询器具维修记录子详情
export const getContainerRepairRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/container-repair-record-detail/get?id=` + id })
}
// 新增器具维修记录子
export const createContainerRepairRecordDetail = async (data: ContainerRepairRecordDetailVO) => {
return await request.post({ url: `/wms/container-repair-record-detail/create`, data })
}
// 修改器具维修记录子
export const updateContainerRepairRecordDetail = async (data: ContainerRepairRecordDetailVO) => {
return await request.put({ url: `/wms/container-repair-record-detail/update`, data })
}
// 删除器具维修记录子
export const deleteContainerRepairRecordDetail = async (id: number) => {
return await request.delete({ url: `/wms/container-repair-record-detail/delete?id=` + id })
}
// 导出器具维修记录子 Excel
export const exportContainerRepairRecordDetail = async (params) => {
return await request.download({ url: `/wms/container-repair-record-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-repair-record-detail/get-import-template' })
}

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

@ -0,0 +1,69 @@
import request from '@/config/axios'
export interface ContainerRepairRecordMainVO {
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 getContainerRepairRecordMainPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/wms/container-repair-record-main/senior', data })
} else {
return await request.get({ url: `/wms/container-repair-record-main/page`, params })
}
}
// 查询器具维修记录主详情
export const getContainerRepairRecordMain = async (id: number) => {
return await request.get({ url: `/wms/container-repair-record-main/get?id=` + id })
}
// 新增器具维修记录主
export const createContainerRepairRecordMain = async (data: ContainerRepairRecordMainVO) => {
return await request.post({ url: `/wms/container-repair-record-main/create`, data })
}
// 修改器具维修记录主
export const updateContainerRepairRecordMain = async (data: ContainerRepairRecordMainVO) => {
return await request.put({ url: `/wms/container-repair-record-main/update`, data })
}
// 删除器具维修记录主
export const deleteContainerRepairRecordMain = async (id: number) => {
return await request.delete({ url: `/wms/container-repair-record-main/delete?id=` + id })
}
// 导出器具维修记录主 Excel
export const exportContainerRepairRecordMain = async (params) => {
return await request.download({ url: `/wms/container-repair-record-main/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/wms/container-repair-record-main/get-import-template' })
}

8
src/views/wms/inventoryManage/container/containerMain.data.ts

@ -30,8 +30,12 @@ export const ContainerMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '状态',
field: 'status',
label: '器具状态',
field: 'containerStatus',
dictType: DICT_TYPE.CONTAINER_STATUS,
dictClass: 'string',
isTable: true,
isForm: true,
sort: 'custom',
isSearch: true,
},

135
src/views/wms/inventoryManage/containerinit/containerRepair/containerRepairRecordMain.data.ts

@ -0,0 +1,135 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ContainerRepairRecordMainRules = reactive({
})
export const ContainerRepairRecordMain = 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,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ContainerRepairRecordDetailRules = reactive({
})
export const ContainerRepairRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 150
}
},
{
label: '器具号',
field: 'containerNumber',
sort: 'custom',
table: {
width: 150
}
},
{
label: '从状态',
field: 'fromContainerStatus',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
table: {
width: 150
}
},
{
label: '到状态',
field: 'toContainerStatus',
sort: 'custom',
isSearch: true,
form: {
component: 'Radio'
},
table: {
width: 150
}
},
{
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: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

285
src/views/wms/inventoryManage/containerinit/containerRepair/index.vue

@ -0,0 +1,285 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="ContainerRepairRecordMain.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ContainerRepairRecordMain.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="ContainerRepairRecordMainRules"
:formAllSchemas="ContainerRepairRecordMain.allSchemas"
:searchTableParams="searchTableParams"
:tableAllSchemas="ContainerRepairRecordDetail.allSchemas"
:tableFormRules="ContainerRepairRecordDetailRules"
:tableData="tableData"
:apiUpdate="ContainerRepairRecordMainApi.updateContainerRepairRecordMain"
:apiCreate="ContainerRepairRecordMainApi.createContainerRepairRecordMain"
@searchTableSuccess="searchTableSuccess"
:isBusiness="true"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@submitForm="submitForm"
/>
<!-- 详情 -->
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ContainerRepairRecordMain.allSchemas"
:detailAllSchemas="ContainerRepairRecordDetail.allSchemas"
:detail-all-schemas-rules="ContainerRepairRecordDetailRules"
:searchTableParams="searchTableParams"
:apiCreate="ContainerRepairRecordDetailApi.createContainerRepairRecordDetail"
:apiUpdate="ContainerRepairRecordDetailApi.updateContainerRepairRecordDetail"
:apiPage="ContainerRepairRecordDetailApi.getContainerRepairRecordDetailPage"
:apiDelete="ContainerRepairRecordDetailApi.deleteContainerRepairRecordDetail"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/container-repair-record-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ContainerRepairRecordMain,ContainerRepairRecordMainRules,ContainerRepairRecordDetail,ContainerRepairRecordDetailRules } from './containerRepairRecordMain.data'
import * as ContainerRepairRecordMainApi from '@/api/wms/containerRepairRecordMain'
import * as ContainerRepairRecordDetailApi from '@/api/wms/containerRepairRecordDetail'
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: 'ContainerRepairRecordMain' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(ContainerRepairRecordMain.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: ContainerRepairRecordMainApi.getContainerRepairRecordMainPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn({hasPermi:'wms:container-repair-record-main:create'}), //
defaultButtons.defaultImportBtn({hasPermi:'wms:container-repair-record-main:import'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:container-repair-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-repair-record-main:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-repair-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)
}
//
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, 'basicContainerRepairRecordMain')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ContainerRepairRecordMainApi.deleteContainerRepairRecordMain(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 ContainerRepairRecordMainApi.exportContainerRepairRecordMain(setSearchParams)
download.excel(data, '器具维修记录主.xls')
} catch {
} finally {
exportLoading.value = false
}
}
//
const submitForm = async (formType, data) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await ContainerRepairRecordMainApi.createContainerRepairRecordMain(data)
message.success(t('common.createSuccess'))
} else {
await ContainerRepairRecordMainApi.updateContainerRepairRecordMain(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
//
getList()
} finally {
basicFormRef.value.formLoading = false
}
}
const tableData = ref([])
const tableFormKeys = {}
ContainerRepairRecordDetail.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 ContainerRepairRecordMainApi.importTemplate()
})
</script>

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

@ -133,6 +133,16 @@ export const ContainerMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 300,
fixed: 'right'
},
}
]))

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

@ -144,8 +144,26 @@ const buttonBaseClick = (val, item) => {
// -
const butttondata = [
defaultButtons.mainListEditBtn({hasPermi:'wms:containerMain:update'}), //
defaultButtons.mainListDeleteBtn({hasPermi:'wms:containerMain:delete'}), //
defaultButtons.mainListEditBtn({hasPermi:'wms:container-main:update'}), //
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:container-main:delete'}), //
{
label: '维修',
name: 'repair',
hide: false,
type: 'primary',
color: '',
link: true, //
hasPermi: ''
},
{
label: '报废',
name: 'scrap',
hide: false,
type: 'danger',
color: '',
link: true, //
hasPermi: ''
}
]
// -
@ -154,9 +172,33 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if(val == 'repair'){ //
repairSubmit(row.id)
} else if(val == 'scrap'){ //
scrapSubmit(row.id)
}
}
/** 维修按钮操作 */
const repairSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
await ContainerMainApi.repairSubmitContainerRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
} catch {}
}
/** 报废按钮操作 */
const scrapSubmit = async (id: number) => {
try {
await message.confirm(t('common.confirmSubmit'))
await ContainerMainApi.scrapSubmitContainerRequestMain(id)
message.success(t('common.submitSuccess'))
await getList()
} catch {}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {

Loading…
Cancel
Save